http://www.diva-portal.org/smash/record.jsf?pid=diva2:318894
Capturing JUnit Behavior into Static Programs: Static Testing Framework
Siddiqui, Asher
Linnaeus University, Faculty of Science and Engineering, School of Computer Science, Physics and Mathematics.
In this research paper, it evaluates the benefits achievable from static testing framework by analyzing and transforming the JUnit3.8 source code and static execution of transformed code. Static structure enables us to analyze the code statically during creation and execution of test cases. The concept of research is by now well established in static analysis and testing development. The research approach is also increasingly affecting the static testing process and such research oriented work has proved particularly valuable for those of us who want to understand the reflective behavior of JUnit3.8 Framework.
JUnit3.8 Framework uses Java Reflection API to invoke core functionality (test cases creation and execution) dynamically. However, Java Reflection API allows developers to access and modify structure and behavior of a program. Reflection provides flexible solution for creating test cases and controlling the execution of test cases. Java reflection helps to encapsulate test cases in a single object representing the test suite. It also helps to associate each test method with a test object. Where reflection is a powerful tool to perform potential operations, on the other hand, it limits static analysis. Static analysis tools often cannot work effectively with reflection.
In order to avoid the reflection, Static Testing Framework provides a static platform to analyze the JUnit3.8 source code and transform it into non-reflective version that emulates the dynamic behavior of JUnit3.8. The transformed source code has possible leverage to replace reflection with static code and does same things in an execution environment of Static Testing Framework that reflection does in JUnit3.8. More besides, the transformed code also enables execution environment of Static Testing Framework to run test methods statically. In order to measure the degree of efficiency, the implemented tool is evaluated. The evaluation of Static Testing Framework draws results for different Java projects and these statistical data is compared with JUnit3.8 results to measure the effectiveness of Static Testing Framework. As a result of evaluation, STF can be used for static creation and execution of test cases up to JUnit3.8 where test cases are not creating within a test class and where real definition of constructors is not required. These problems can be dealt as future work by introducing a middle layer to execute test fixtures for each test method and by generating test classes as per real definition of constructors.
JUnit3.8 Framework, Test Case, Test Object, Test Method, Reflection, Test Fixture, Test Suite, Test Pack, Dynamic Behavior, Static Behavior, Static Analysis, Code Generation Environment, Execution Environment, Test Object Hierarchy, Assertion, Result Parameters, Source Code Transformation, Building Process, Test Case Execution, Potential Operations, Java Reflection API, Java Object Model, Annotation, Meta-Model, Call Graph, Reflection Resolution, BDD Database
2010-05-12, B3037, School of Computer Science, Physics and Mathematics, SE-351 95 Växjö, Sweden, D Building, 13:15 (English)
Gutzmann, Tobias, Mr
Lowe, Welf, Mr
fb62b0b15ffc828142d9428f2f16d45e33a3f30c4a24e4e0f0c42dff519557dc4dfe3e4fed62f60dd0b10eef994e0a743153ff6393b2c903be8bc5eecc9e2773
School of Computer Science, Physics and Mathematics