Testing
Steve Loughran
HP Laboratories
Thursday November 17th, 2005
your code doesn't work
I know this because...
my code doesn't work
you are allowed to write code
that doesn’t work
just don’t ship it
how do you get from "broken" to
"go live"?
Device Drivers
ship and see
test it!
Test-Driven
∃x:
(∀y∈[1..x]:
f(y)>0)
Formal Methods
prove it works
proofs of correctness
+ shows an algorithm really works
+ good for concurrency
+ and distributed things
- makes assumptions about system
- needs lots of maths/CS skills
(Pi-Calculus, The HOL System)
- regression proofs?
Test Driven Development
any feature without a test
doesn’t exist
JUnit
* unit test framework in Java
(or C++, Python, Ruby, C#, ...)
* simple to learn
* good tool support
* somewhat low-level
* extensions for system testing
public class LessSimpleTest extends TestCase {
public LessSimpleTest(String s) {
super(s);
}
public void testAssignment() {
final Date date = new Date();
Event event = new Event(UUID.randomUUID(),
date, "now", "Text");
assertEquals("self equality failed",
event, event);
assertEquals(date, event.getDate());
assertNotNull(date.getID());
}
}
System Testing
* deploy, then:
HttpUnit, XmlUnit, Cactus
* needs automated deployment
* Distributed Testing still a research topic
* performance testing by comparing timings w.r.t.
old runs
Ant-generated report
scales better; reports published
Continuous Integration
Apache Gump gump.apache.org
Nightly build of OSS Java apps.
For any project with public CVS/SVN
Interop Testing
* Your client against my server
* My client against your server
Issues:
* Blame assignment: a formal test suite makes
blame easier to assign
* Dependent libraries: what if your WS-A doesn’t
interop with others?
Test Driven Standards?
any standard without a test
doesn’t exist

Testing

Editor's Notes

  • #5 Nor does anyone else's. Not first time, anyway.
  • #6 Welcome to low-quality-coders anonymous
  • #7 This Bluescreen is courtesy of Sony's 'enhanced' CD. Music that can toast your PC. Whatever next?
  • #8 One of the big problems of Software Engineering. The others are -scale -change
  • #10 I'm not going to deny the value of formal proofs of things. I mean, how do you know quicksort works? However, they are hard to do, and a skill that is not broadly known in the sw eng community. If you have the skill, use it when appropriate.
  • #17 This is cruise control. see also gump.apache.org These are machines that