SWEN-220 Mathematical Models of Software
Fall 2171

Section 01: Mon-Wed-Fri  2:30-3:25

Professor Tom Reichlmayr

(01) myCourses shell

Syllabus

Textbooks-

All required texts are available online through the RIT Wallace site: http://library.rit.edu/ 
Copy the title of the book into the search bar. 


Week
Topics / Sildes

Activities / Reading / Videos

See myCourses Dropbox for submission due dates.
See myCourses -> Content -> Video for video links.
Projects / Exams

Week 1 (Aug 28)


PART I - Relational (Data) Modeling


Course Introduction

Relational Model - Overview

Relational Model - Operations




[Alloy]
- Chpt 1 : Introduction 
(focus on terms "abstraction" & "model")

[ERD] - Chpt 1 : Introduction

Lamport Video: first 9-10 minutes. We are not using TLA+, but we will use similar modeling tools. Focus on the  value of using models & abstractions when designing & testing software.



Week 2 (Sep 4)

No Class
Mon 9/4
Labor Day

Last Day to       Add/Drop 
Tues 9/5




Conceptual Modeling - ERD Intro

Course Registration Example


ERD Modeling Activity #1

ERD Project Available

Week 3 (Sep 11)




Conceptual -> Relational Mapping

Course Registration Mapping

Normalization

Relational Model ->  Relational Database 


ERD Modeling Activity #2 :
Using the ERD solution from Activity #1 define the relational model using Relational Schema Notation (RSN).


ERD Modeling Activity #3




Week 4 (Sep 18)


PART II - Structural Modeling
(Alloy)

Alloy-01 : Alloy Introduction

Relational Model - Operations (review)


Video - Hello Alloy

Alloy Activity #1 - Course Registration






ERD Project Due
Mon - 9/18


Exam #1 : Relational Modeling
Wed - 9/20




Week 5 (Sep 25)



Alloy-03 : Alloy Logic

Alloy-04 : Alloy Navigation - Join



Alloy Activity #2 - Friends & Enemies

Alloy Project Out

Week 6 (Oct 2)

No Class
Wed 10/4

Career Fair



Alloy-05 : Transitive Closure






Alloy Activity #3 - FoodDB










Week 7 (Oct 9)

No Class
Mon 10/9

October Break

Puzzles - Ordered & Unordered

Alloy-06 : Let and Functions

Alloy Activity #4 - Ordered Puzzle (Ice Cream)



Alloy Project R1 Due
Wed 10/11 - 11:59 PM


Exam #2 : Alloy Modeling 
Fri -10/13



Week 8 (Oct 16)



Alloy-07 : Dynamic Modeling

Alloy-08 : Dynamic Summary

















Week 9 (Oct 23)


PART III -  Behavioral Modeling
(SPIN/Promela)

SPIN-01a : Concurrency Introduction
SPIN-01b: Shared Mutable State
SPIN-01c: Deadlock

Java Concurrency Tutorial




Java Threading Activity

[SPIN] -  Chapters  1 & 2

Alloy Project R2 Due
Wed 10/25 - 11:59 PM




Week 10 (Oct 30)


SPIN/Promela Introduction
Modeling Concurrency
Semaphores

Slides:
SPIN-02 : SPIN/Promela Intro
SPIN-03 : Modeling Concurrency - Pt 1

A Primer on Model Checking

Video - Hello SPIN - see myCourses

SPIN Activity #1 - LCM


SPIN Activity #2 - Ice Cream Race


[SPIN] - Chapters 3 & 4


Week 11 (Nov 6)

Last Day to       Withdraw
Fri (11/10)


Verification in SPIN
Synchronization - Semaphores

Slides:
SPIN-04 : Modeling Concurrency - Pt 2

SPIN Activity #3 - Modify Dinning Philosopher model to prevent deadlock





SPIN Project Out
R1 Due Mon (11/27)
R2 Due Mon (12/11)


Week 12 (Nov 13)




Verification with temporal logic

[] and <>
Safety and liveness in LTL

Slides:
SPIN-05 : SPIN Verification
SPIN-06 : Temporal Logic

Sleeping Barber Problem

Read :
[SPIN] - Chapter 5
Exam #3 :
Concurrency Concepts & Promela Intro
Monday - Nov 13

Week 13 (Nov 20)

No Class
Wed, Fri 11/22-24

Thanksgiving 

Channels
Sending messages
Receiving messages

Slide:
SPIN-07 : Channels & Messaging



Read :
[SPIN] - Chapter 7.1-7.4

Week 14 (Nov 27)


Channels
Sending messages
Receiving messages
SPIN Activity #4 

SPIN Project R1 Due
Mon (11/27) - 11:59 PM



Week 15 (Dec 4)


Producer-Consumer Model

Additional Channels topics





SPIN Activity #5 






Week 16 (Dec 11)
Last Class
Mon 12/11
Java Messaging Systems (TBD)


Final Review

ERD Review Activity

Alloy Review Activity


SPIN Project R2 Due
Mon (12/11) - 11:59 PM

Final Exam
Monday 12/18
2:45 PM - 4:45 PM
GOL-1550



Resources:

Tools:

Disclaimer: While you are free to install Alloy and Spin on your personal computers, there may be some "quirks" based on your machine's configuration (especially SPIN on Mac's). I would strongly suggest defaulting to the lab systems for all on-line exams and testing projects and activities. All grading will be done using an SE Lab image. I will create a discussion forum in myCourses for students to share installation advice.
 
Alloy
  1. The Alloy community web site is at alloy.mit.edu.
  2. If you want to install Alloy on your own computer:
    1. In the upper pane, click the download link.
    2. Select either alloy4.2.dmg for OS X or alloy4.2.jar for Windows or Linux; in all cases you need at least Java 6 to run the tool.
  3. The documentation link in the upper pane leads to a page with several useful links (we suggest bookmarking this link):
    1. An FAQ about Alloy.
    2. A reference manual
    3. A quick guide to Alloy 4
    4. An on-line tutorial
    5. Slides from a one day tutorial.
Promela / Spin
  1. Our primary source for information on Promela (the PROtocol MEta LAnguage) and SPIN (Simple Promela INterpreter) is the text by Ben-Ari. Gerard Holzman, the creator of the system, has a book that goes deeper in to the underlying theory, but it's more than we need.
  2. A good supplemental source is on the SPIN community website, spinroot.com. This is where you can find downloadable versions of the tools for your own computers. In addition, there are tutorials and a community forum.
  3. To download jSPIN 5.0 for Windows go to Google Code and select jspin-5-0.exe
    https://code.google.com/archive/p/jspin/downloads?page=2
  4. To download SPIN for Mac go to the SPIN site and follow instructions for Mac installation
    http://spinroot.com/spin/Man/README.html

    Here are some additional Mac installation tips: jSpin for Mac and Linux

Data Modeling - Entity Relationship Diagrams (ERD)
  1. There are a number of ERD-like drawing tools available. In class, and for your own use I would suggest Lucidchart : https://www.lucidchart.com/. You will need to sign-up (free) with your RIT email address (*.rit.edu) in order to get features beyond the normal trial sign-up Lucidchart offers.
  2. Another  tool to look at is the ERD features in Microsoft Visio. Visio is installed on the SE lab machines and is available through the SE Deptartment's Academic Alliance with Microsoft: http://www.se.rit.edu/content/software-vendor-alliances (Note that Lucidchart is able to import Visio diagrams.)