3

How do we apply JML to Java Code? I'm still new in Design by Contracts and quite lost on how to apply it into the program.

http://jmlspecs.sourceforge.net/

Using:

  • OpenJML
  • Netbeans 7.3
  • Java SDK 1.7

I have already added the OpenJML jar files into the classpath of Netbeans. i tried the cofoga google jml version where you simply import com.google.java.contract.Ensures; import com.google.java.contract.Requires then you can add the pre and post conditions

How do we specify the pre condition and post condition using openJML in my program?

Majid
  • 13,853
  • 15
  • 77
  • 113
Mark
  • 65
  • 7

1 Answers1

1

I found what that is needed; is importing the library with annotations:

import org.jmlspecs.annotation.Requires;
import org.jmlspecs.annotation.Ensures;
Majid
  • 13,853
  • 15
  • 77
  • 113
Mark
  • 65
  • 7