CS447 Lecture 3: L12.pdf

22 views3 pages
16 Apr 2015
Course
Professor

Document Summary

We"ll move further up the abstraction chain now and talk about testing based on speci cations. Speci cation-based testing can help ensure that a system doesn"t drift too far from its intended behaviour, and tends to focus on higher-level concerns than the testing we"ve seen so far, which is based on properties of the source code. Libraries often come with constraints on permissible actions; we call these constraints sequencing constraints. The general format of sequencing constraints is do x before y , or don"t do w before a . Here is another sequencing constraint, this one implicit. /* @requires size() > 0 */ public int dequeue() { } /* @ensures size() = \old(size()) + 1 */ public void enqueue (int x) { } Assuming that the only way to increase size() is by calling enqueue(), then a client had better call enqueue() before calling dequeue().

Get access

Grade+
$40 USD/m
Billed monthly
Grade+
Homework Help
Study Guides
Textbook Solutions
Class Notes
Textbook Notes
Booster Class
10 Verified Answers
Class+
$30 USD/m
Billed monthly
Class+
Homework Help
Study Guides
Textbook Solutions
Class Notes
Textbook Notes
Booster Class
7 Verified Answers

Related Documents