JML JUnit - PowerPoint PPT Presentation

1 / 6
About This Presentation
Title:

JML JUnit

Description:

1. JML - JUnit. 2. Goals. Continuous unit testing (XP) Tie in with formal specifications ... Constructs test cases from test data. Assembles test cases into ... – PowerPoint PPT presentation

Number of Views:104
Avg rating:3.0/5.0
Slides: 7
Provided by: nellyd
Category:
Tags: jml | junit | tie

less

Transcript and Presenter's Notes

Title: JML JUnit


1
JML - JUnit
2
Goals
  • Continuous unit testing (XP)
  • Tie in with formal specifications
  • Problems
  • Writing unit test code is hard
  • Duplication between
  • Code for test oracles
  • Formal specifications

3
Specification as Test Oracle
  • Write abstract pre- and postconditions
  • Run test cases with assertion checking on
  • Monitor assertion violations
  • Why doesnt that work?

4
Tool Overview
  • Users only
  • Write specifications
  • Supply test data of each type
  • System automatically
  • Constructs test cases from test data
  • Assembles test cases into test suites
  • Executes test suites
  • Decides success or failure
  • Reports results

5
Usage
  • jtest Person.java generates and compiles test
    classes for JML-JUnit testing
  • Add test data to Person_JML_TestData.java and
    recompile
  • jml-junit Person_JML_Test runs JUnit tests
  • but tests must have been compiled with JML's
    runtime assertion checking compiler jmlc

6
Test Suites are Cross Products
  • For each receiver, test method
  • For each method m(T1 arg1, T2 arg2) provide
  • (x1, x2) x1in T1-TestData and x2 in
    T2-TestData
  • Default is to use all data for all methods
  • Filtered automatically by preconditions
  • User can filter if desired
Write a Comment
User Comments (0)
About PowerShow.com