Software testing is usually viewed as an unneeded expense added to projects. Customers and project managers prefer not to pay for testing. Even advocates of software testing run tests, but frequently perform a minimal amount of testing. Too often, the testing done is to fulfill some minimum requirement for certification. Setting up these tests takes lots of time and money; executing these tests adds to the cost. The people required to set and run these tests usually are highly paid experts who are familiar with the software.
Experts say 50% of the software budget should be used for testing . In reality, software projects spend an average of 10% on testing (citation ...view middle of the document...
Developers can access Twitter and use tweets in their applications, upload content like pictures, and perform analytics on the tweets. Twitter4J was chosen for several reasons:
• Twitter4J is Java-based
• Twitter4J has a mature, well-established codebase with a large group of developers
• Twitter4J has been actively developed since 2007  
• Twitter4J has an existing test suite
• Twitter4J is one of the most popular open-source java projects 
Twitter4J is made up of seven smaller projects integrated together. The seven projects are: twitter4j-appengine, twitter4j-async, twitter4j-core, twitter4j-examples, twitter4j-media, twitter4j-spdy, and twitter4j-stream. Twitter4J contains over 30,000 source lines of executable code. See Table 1 for a breakdown of the lines of code.
Table 1: Breakdown of Twitter4J Components
Twitter4J documentation is available at http://twitter4j.org/javadoc/index.html?overview-summary.html.
Code coverage is a measure of how much of the code is executed, typically during test. Each executable statement or instruction is marked before running the tests. The code is marked as covered after the statement or instruction is executed or partially executed. At the end of the tests, the executed and not executed lines of code are counted and statistics are presented about the code coverage. The code coverage tool can display the metrics and show the code executed and not executed.
EclEmma is the code coverage tool used to measure the lines executed by the existing test suite and by the tests generated by random testing. EclEmma is a highly regarded and popular code coverage tool for Java, and includes a plugin for Eclipse called JaCoCo.
EclEmma looks at instructions in the Java bytecode. Instructions are the result of breaking down the source code into a single executed command. For instance, x = 1; is a line of code containing a single instruction. A statement like for (x=1; x< 5; x++) contains three instructions:
1. x = 1
2. x < 5
3. x = x + 1
The statement int x; does not contain executable code. Executable code is broken down into instructions; comments and white spaces are ignored. The total number of Java instructions in Twitter4J is about 66000 (see Table 1). This number does not count tests, resource files, and libraries developed outside of Twitter4J.
EclEmma weighs all instructions equally, and does not disregard unreachable instructions. EclEmma notes if any choice is not executed in a forked statement (like an “if” statement when there is no “else”). The number of times an instruction is likely to be executed is not taken into consideration by EclEmma, nor how critical the instruction is to the program.
EclEmma marks statements in green if all of the instructions generated by the line of code were executed; marks statements in red if none of the instructions generated by the code were executed; and marks statements in yellow if part of the instructions generated by the...