You are on page 1of 24

U

Bug

5. Tools for software Testing


U
Why Automated Testing usually go wrong (A)
Cost of Automated Testing

Cost

Num of Repeat of Test


Advertisement of tool

Manual
Automate Testing Actual Situation
U
Why Automated Testing usually go wrong (B)
Reasons: Failure of using Automated Testing
•Using Automated Tools without reformation of work
regulation and work flow.
No strategy, only install automated tools
•Too much hope to Automated testing
Only automated tools doesn’t solves the problem
•Not enough training, Low capability of testers
Testers don’t know test itself.
•Wrong Test Tools
U
What kind of tools are easy to use
Tool Personal Group
Easy Effect Easy Effect
Static Analysis: Style Check XXX XXX X XXX
Static Analysis: Bug Detect XXX XXX X XXX
Code Metrics XX XX X XX
Test design/ Test case/ Executing: XX XXX X XX
Component Test supporting
Test Executing: Record/Replay XXX X XXX X
Test Executing: Record/Replay Web X XX X XX
Performance Testing: profile X XX X XX
Performance Testing: Record/Replay XXX XXX XXX XXX
Incident Management - - XX XXX
Test Case Management - - XXX XX
Configuration Management - - XXX XX
U
What kind of Tests are fit for Automated Testing
Type of Testing Good Bad
Smoke Testing X
Performance Testing X
Testing of API X
Regression Testing X? X?
Testing of GUI X? X?
Testing of fixed specification X
Testing in different environment X
Data driven Test ( Same operation, deferent data) X
U
Installation of eclipse plug-in (1)
Most plug-ins will have an update site, making it easy to add
and update plug-ins within Eclipse.
Step1: [Help]-[Install New Software…]
U
Installation of eclipse plug-in (2)
Step2: Adding new site [ Add…] Button
U
Installation of eclipse plug-in (3)
Step3: Input location of site

Plug-in Location
Checkstyle Plug-in http://eclipse-cs.sf.net/update/
FindBugs http://findbugs.cs.umd.edu/eclipse
Metrics plugin for Eclipse http://metrics.sourceforge.net/update
djUnit http://works.dgic.co.jp/djunit/update/3.5.x/site.xml
The Eclipse Web Tools http://download.eclipse.org/webtools/repository/helios
Platform (WTP)
U
Installation of eclipse plug-in (3)
Step3: Selecting the module and installation
U
Metrics plugin for Eclipse (1)
Step1: Enable Metrics: [Properties]
U
Metrics plugin for Eclipse (2)
Step1: Showing Metrics Windows
[Windows] – [Others…]
U
Metrics plugin for Eclipse
Metrics of Program
U
Metrics plugin for Eclipse
McCabe Cyclomatic Complexity
U
JUnit (1)
Step1: Making Test Class: [New]-[JUnit Test Case]
U
JUnit (2)
Step2: Defining Test Class
U
JUnit
JUnit generates framework of test program and
programmer add checking code.

package hoge;
public class Counter {
public int add(int num1, int num2) {
return num1 + num2;
}
public int subtract(int num1, int num2){
return num1 - num2;
}
}

Target Program
Deriver Program
generated by JUnit

JUnit also provides test class to check results


U
JUnit
Run Test program : [Run As] – [JUnit Test]
U
JUnit
JUnit shows the result of test.
U
djUnit : mainly measuring coverage

Run Test program by dj Unit: [Run As] – [djUnit Test]


U
djUnit
Report of coverage by djUnit
U
djUnit
Report of unteted code (colored yellow) by djUnit
U
public void testLen2() throws Throwable {
JUnit Factory boolean result = new CheckNumber().len2(9);
assertFalse("result", result);
}
public void testLen21() throws Throwable {
boolean result = new CheckNumber().len2(100);
assertFalse("result", result);
}
public void testLen22() throws Throwable {
boolean result = new CheckNumber().len2(11);
public class CheckNumber { assertTrue("result", result);
public boolean len2(int n){ }
if(n>=10&&n<=99){ public void testLen23() throws Throwable {
return true; boolean result = new CheckNumber().len2(98);
} else { assertTrue("result", result);
return false; }
} public void testLen24() throws Throwable {
} boolean result = new CheckNumber().len2(99);
assertTrue("result", result);
Target Program
}
public void testLen25() throws Throwable {
boolean result = new CheckNumber().len2(10);
assertTrue("result", result);
}

Deriver Program generated by


JUnit Factory
U
Selenium IDE:
Record and playback of borwser operation
U
Selenium AES
Time Automated running

You might also like