Make it simple?

2plus2 Make it simple?Specification is important – this statement is clear to everyone. A widely used product, technology or language without a specification is useless. A specification without a testsuite is dangerous. A testsuite without markup and tests is impossible. This process is quite complex. However there are ways to simplify the markup stage.

As for Java Language Specification (JLS) and Java Virtual Machine Specification (JVMS) they are written in FrameMaker. Afterwards spec is exported to html and pdf. The markup is embedded into html version. My opinion is that markup information should be placed into (or connected with) the origin text. In our case it is FrameMaker document. I’m not sure that this is possible at all, but my guess it is. If not, maybe FrameMaker is not the best solution. As a result we will significantly reduce the amount of time and effort needed for transferring old markup and marking up new text. Moreover during writing the next revision of spec the auther together with tck team should markup all chenged and new assertions. I’d say the best way is when the spec writing and the markup processes are done at the same time. It is reasonable for the auther to point out the test developers what statements should be tested.



, , , , , , , , , , , , , ,
       

    Specification, conformance, compatibility, tests… What are they all about?

    Sometimes all this terms seem quite confusing. Or it’s better to say they usually or even always do. abstract Specification, conformance, compatibility, tests... What are they all about?Especially when different people and companies understand the situation around them in different ways. So let’s start from the very beginning.

    There are lots of specifications or standards around us. Webster dictionary describes standard as something established by authority, custom, or general consent as a model or example. So basically it is the list of rules, which others while using have to obey.

    Let’s create a computer language. First of all the specification is needed, that will describe the whole concept model, tell developers what can be written as a program, how it will behave, what will be compiled, executed and etc. After creating all these necessary documents – that’s it, one can stop right there. If the idea is good enough several other companies might want to create their implementations: f.e. compilers and executing environments. But they must obey the specification. Otherwise the same programs will run on one and run differently or even fail on the other implementation. Fulfillment by an implementation of all specified requirements is called conformance.

    Why is it so important? money coins Specification, conformance, compatibility, tests... What are they all about?Well, let’s say this new language was used to create a program for stock exchange. Imagine it was written in the US, well tested and used at NYSE. It was so good, that other countries all over the world bought a license and started using it on their implementation of this new language. If an implementation didn’t obey the spec, the same program might do different things with clients’ money. Basically this stock exchange program might sell when commercial agent pushed the “buy” button, or buy steel instead of fruit.

    The good question could be: “Why different implementations? Let’s create one and use it.”. There are different answers. Several companies might want to use this language on different platforms (Solaris, Linux, Windows) and devices (desktop, mobile phone, PDA, student calculator, etc). Others want to optimize algorithms for their needs, f.e. implement them so the big database program will be 10 times faster.

    The key point is that several different implementations must work exactly the same and according to the spec. If they do so they are called compatible. The bad part is that no one can be sure. That is why the verification mechanism is needed. Usually it is a test suite that verifies the conformance and compatibility. And in this case it is wrong to say that something is almost compatible or 99% compatible. There could be either yes or no.

    no bug2 Specification, conformance, compatibility, tests... What are they all about?Let’s move towards an example. Sun Microsystems invented Java language. To be more precise several versions of Java for different markets were created. The most famous are Java ME, Java SE and Java EE. And for each of them there is a separate specification. Sun Microsystems has its own implementation, which is most commonly used. However the language is so good, that there are quite a few other companies and their implementations. For compatibility and conformance purposes there are TCKs (Test Conformance Kit). TCK is a product that includes a number of tests, which check if an implementation is correct according to the rules from specification.

    My intend was to give an idea of what specification, conformance, compatibility and TCK are and why they are so important.



    , , , , , , , , , , , , , , , , , , ,
         

      99% – is it enough or not?

      99%Today is a great day. I will try to explain why. As I mentioned in my intro-post our team is creating several different TCK’s. The area that I work on is so-called LANG – I develop tests for Java Language. Long ago, more than 2 years from now, we started to work on JLS 3 specification. We had to solve many problems which often occur during spec change (I promise to write more about that). Our team is finishing JCK 6a, lang tests is part of this JCK. Today I run the coverage scripts and we can finally say that we have 99% assertion coverage for JLS 3. To be more precise we have 99.4%. It means that we wrote tests for 99% of sentances in JLS 3 that we had marked as potentially testable. Isn’t it cool? I bet it is!

      The work is certainly not over yet and will not be so - there are many reasons why more tests are needed :

      • depth coverage improvement – more tests for several assertions are needed;
      • there are sentances that are testable, but for several reasons we hadn’t marked them as potentially testable;
      • there will be JLS 4 soon, we should start working on it as soon as possible.

      Different people might have opposite answers for a question in a title.  Most would say "Yes, of course". Indeed 99% is almost 100%. And what is 100% – it is a perfection. 99% looks great, and it is great. But we must understand what this number stands for, and what can be improved. My opinion is "yes, it is great, colossal, tremendous; but no, it’s not enough, I want more, even more than 100%", that’s why I plan to create a script for depth coverage calculation.

      Thanks to all SUN developers who did JCK-Lang work, thanks to people who helped (especially to compiler team) and certainly great thanks to all developers who use Java :-)

      Java world became even more compatible and safer!



      , , , , , , , , ,