120 likes | 138 Views
Explore mathematical reasoning in software development through contracts and reasoning exercises, modeled on stack operations. Learn about course structure, modeling, and project examples.
E N D
Mathematical Reasoning across the Curriculum Software Development Foundations and Software Engineering Murali Sitaraman Clemson University This research is funded in part by NSF grants CCF-0811748 and DUE-1022941
You can find lot more details at… Bing or Google: Clemson RESOLVE
Math Reasoning at Clemson • CP SC 215: Software Development Foundations (SDF) • Intro to Java, Objects, and SE • 2-3 weeks of contracts and reasoning • CP SC 372: Software Engineering (SE) • Classical SE topics • 4-5 weeks of contracts and reasoning
SDF Course Reasoning Example • Assume |S| /= 0 and S = S0; • S.Push(S.Pop()); • Confirm S = S0;
Math Modeling: IntStack Contract Suppose IntStack is an interface uses Integer_Theory, String_Theory; Think of stacks of Integers as “math strings” of integers this: Str(Z); Specification of Constructor Initialization ensures this = empty_string; Exercises: Specification of other Stack operations
Specification of IntStack Interface Operation push (int x); updates this; restores x; ensures this = <x> o #this; int Operation pop (); updates this; requires this /= empty_string; ensures #this = <result of pop()> o this; bool Operation is_empty(); preserves this; ensuresresult of is_empty = (this = empty_string);
Contract specifications • Requirements and guarantees • Requires clauses are preconditions • Ensures clauses are postconditions • Who is responsible for requires clauses? • Client (i.e., caller) • Implementer • Neither • Both • Consequences
Some more details… • Henderson & Sitaraman, “Mathematical reasoning at the Crossroads,” ACM Inroads Magazine, March 2012 issue. • Joe Hollingsworth YouTube “reasoning table” videos • Cook, et al., ITiCSE 2012 Procs. • www.cs.clemson.edu/group/resolve
SE Course Highlights • Covers classical topics, such as process models, requirements analysis, design with UML, etc. • About a third of the course is devoted to mathematical contracts and reasoning • Component-based development project with formal contracts using RESOLVE • Reasoning about the correctness of a subset of the components formally • Use of the Web IDE for experimentation
Example Projects • Develop alternative implementations of Queue_Template, satisfying given internal contracts (e.g., rep. invariants) • a circular array realization • reusing a sequence component • Develop an implementation-independent Queue searching capability and reason about its correctness formally • Recursion • Iteration
Some more details… • Cook, et al., ICSE 2012 Procs. • Cook, Harton, and Smith, YouTube “Clemson RESOLVE” video • RESOLVE is a sourceforge project with MIT license • www.cs.clemson.edu/group/resolve
Workshop invitation • NSF-funded SIGCSE Workshop #27 on Making Math Reasoning Fun tonight at 306 C at 7P!