Java Defects
Click here to load reader
-
Upload
erika-barron -
Category
Technology
-
view
818 -
download
0
description
Transcript of Java Defects
Prevent All Java Software Defects with a Single Tool
2010
Parasoft Proprietary and Confidential
Parasoft Proprietary and Confidential
Automated Analysis Techniques
Application Tracing for Unit TestsPattern-Based Static Code AnalysisRuntime Error DetectionAutomated Unit Test GenerationData Flow AnalysisRegression Testing
Parasoft Proprietary and Confidential
JPetStore Java EE Tutorial
Spring-BasedHSQL DatabaseJSP Web InterfaceApache Tomcat
Introducing the Java Web App
Parasoft Proprietary and Confidential
Similar Items not Aggregating in Shopping Cart
Add one item to the cartAdd the same item againExpected: a single line item with quantity 2Found: 2 line items each with quantity 1
The Problem Report
Parasoft Proprietary and Confidential
Application Tracing for Unit Tests
Record internal method calls inside the running application when the problem occursReplicate the problem in a JUnit testAlter the JUnit test to assert the correct behaviorNow possible solutions can be tested quickly without redeploying the web application
Parasoft Proprietary and Confidential
Pattern-Based Static Analysis
Quick scan to list possible problemsFixing violations prevents certain classes of errorsEach source file is analyzed separatelyStatic analysis categories include:
Logical ErrorsAPI MisuseTypographical ErrorsSecurityThreads and SynchronizationPerformance and Optimization
Parasoft Proprietary and Confidential
Runtime Error Detection
Check for anti-patterns at runtime in the applicationViolations are presented in the context of real-world data values to stress their importanceRuntime error categories include:
Threads and SynchronizationPerformance and OptimizationApplication CrashesFunctional ErrorsSecurity
Parasoft Proprietary and Confidential
Automated Unit Test Generation
Test code branches not covered by the application-level testCombine these unit tests with runtime error detection to check the new execution pathsBuild a baseline regression test suite
Parasoft Proprietary and Confidential
Data Flow Analysis
Simulate hypothetical execution pathsDetect possible errors along those pathsData flow analysis error categories include:
ExceptionsOptimizationResource LeaksAPI misuseSecurity
Parasoft Proprietary and Confidential
Regression Testing
Capture current behavior of covered code pathsWhether the current behavior is right or wrong
Alert when code modifications cause a change in behaviorDevelopers can then mark JUnit assertions as correct behavior to increase the severity if those assertions fail in the future
Parasoft Proprietary and Confidential
Java Software Problems
FunctionalThread concurrencyPerformanceRegressionRequirement TestingCode Review
Parasoft Proprietary and Confidential
Comparable Tools
Static AnalysisData Flow AnalysisUnit Test Framework (with Test Engineer)ProfilerQA Functional TesterCode ReviewCode Metrics MeasurementCode Duplication DetectionTask Management