Personal Medical Unit Lars Sarbæk Kristiansen20050013 Kasper J. Nielsen19980150 Martin Kjeldsen20002072.

Slides:



Advertisements
Similar presentations
JAVA Revision Lecture Electronic Voting System Marina De Vos.
Advertisements

Cash dispenser Function body, pre and post conditions Peter, Raghid og Brian.
Lecture # 21 Chapter 6 Uptill 6.4. Type System A type system is a collection of rules for assigning type expressions to the various parts of the program.
Chapter 10: Inheritance and Polymorphism
COMP 110 Information Hiding and Encapsulation Tabitha Peck M.S. February 25, 2008 MWF 3-3:50 pm Philips
Chapter 11: Inheritance and Polymorphism Java Programming: Program Design Including Data Structures Program Design Including Data Structures.
11/ VIP Elevator – first model A VDM++ Project Made By: Sune Wolff.
CS 1110 Final Exam: Review Session 2 Part 1 : Inheriting classes 1. Inheritance Facts 2. Constructors in Subclasses BREAK : 10 sec. Part 2 : Working with.
Ranga Rodrigo. Class is central to object oriented programming.
Unit 5 School of Information Systems & Technology1 School of Information Systems and Technology (IST)
VDMUnit Testing, Combinatorial Testing, Model Quality and Code Generation Professor Peter Gorm Larsen Department of Engineering, Aarhus University
JUnit The framework. Goal of the presentation showing the design and construction of JUnit, a piece of software with proven value.
Singleton Christopher Chiaverini Software Design & Documentation September 18, 2003.
220 FINAL TEST REVIEW SESSION Omar Abdelwahab. INHERITANCE AND POLYMORPHISM Suppose you have a class FunClass with public methods show, tell, and smile.
Computer Science II 810:062 Section 01 Session 2 - Objects and Responsibilities.
PMU Personal Medical Unit Kasper Høj Jæger Nielsen – Martin Kjeldsen – Lars Sarbæk Kristiansen
CS 2430 Day 9. Announcements Quiz on Friday, 9/28 Prog1: see , see me as soon as possible with questions/concerns Prog2: do not add any public methods.
Inheritance, Abstract & Interface Pepper With help from and
L. Grewe.  An array ◦ stores several elements of the same type ◦ can be thought of as a list of elements: int a[8]
TIVDM1Modelling ordered collections1 Peter Gorm Larsen.
TIVDM1Modelling ordered collections1 Peter Gorm Larsen.
TIVDM2Real-Time and Distributed Development in VDM++1 Peter Gorm Larsen
ECE/CS 584: PVS Tutorial Part 1 Lecture 05 Sayan Mitra 1.
Two Parts of Every ADT An abstract data type (ADT)  is a type for encapsulating related data  is abstract in the sense that it hides distracting implementation.
Chris Kiekintveld CS 2401 (Fall 2010) Elementary Data Structures and Algorithms Inheritance and Polymorphism.
CSC 205 Programming II Lecture 18 The Eight Queens Problem.
TIVDM2Model Quality1 Peter Gorm Larsen. TIVDM2Model Quality2 Agenda  Introduction Internal Consistency External Consistency.
Objects & Dynamic Dispatch CSE 413 Autumn Plan We’ve learned a great deal about functional and object-oriented programming Now,  Look at semantics.
Operating Systems Lecture November 2015© Copyright Virtual University of Pakistan 2 Agenda for Today Review of previous lecture Hardware (I/O, memory,
Object Oriented Programming in C++ Chapter 6 Inheritance.
Introduction to Java Chapter 7 - Classes & Object-oriented Programming1 Chapter 7 Classes and Object-Oriented Programming.
1 Chapter 13-1 Applied Arrays: Lists and Strings Dale/Weems.
More C++ Bryce Boe 2013/10/23 CS24, Fall Outline Project 1 Review Alignment and Padding Finish C++ Introduction.
A brief introduction to doxygen. What does a compiler do?  A compiler ignores comments and processes the code.  What does doxygen do? –It ignores the.
Lecture 9.4 Java Interfaces. © 2006 Pearson Addison-Wesley. All rights reserved Java does not support multiple inheritance. Interface Characteristics...
Static. 2 Objectives Introduce static keyword –examine syntax –describe common uses.
PMU Agenda Concurrent Model Real Time Model. Environment (1) public createEvents: () ==> () createEvents () == ( if len inlines > 0 then ( dcl curtime.
ISBN Object-Oriented Programming Chapter Chapter
Session 6 Comments on Lab 3 & Implications of Inheritance.
Java Programming: From Problem Analysis to Program Design, 3e Chapter 11 Inheritance and Polymorphism.
Programmeren 1 6 september 2010 HOORCOLLEGE 2: INTERACTIE EN CONDITIES PROGRAMMEREN 1 6 SEPTEMBER 2009 Software Systems - Programming - Week.
Tail Recursion l The case in which a function contains only a single recursive call and it is the last statement to be executed in the function. l Tail.
COM S 228 Introduction to Data Structures Instructor: Ying Cai Department of Computer Science Iowa State University Office: Atanasoff.
TIVDM1Sortation System, Tray Allocation1 Tray allocation for a sortation system Iteration III TI-VDM1 Project by José Antonio Esparza and Kim Bjerge.
1 Review for exam 2 CS 101 Spring 2005 Aaron Bloomfield.
Computer Science II 810:062 Section 01 Session 2 - Objects and Responsibilities.
Topic: Junit Presenters: Govindaramanujam, Sama & Jansen, Erwin.
Class Diagrams Revisited. Parameterized Classes Parameterized Classes - are used to represent relationships between templates.
 2000 Deitel & Associates, Inc. All rights reserved. Optional Case Study - Chapter 6 Outline 6.1 Introduction 6.2 Implementation: Visibility 6.3 Implementation:
Java Programming: Guided Learning with Early Objects Chapter 9 Inheritance and Polymorphism.
Introduction to Object-oriented Programming
Class Inheritance Part I
OOP: Encapsulation &Abstraction
Objects as a programming concept
Objects as a programming concept
Agenda Warmup Finish 2.4 Assignments
Chapter 11: Inheritance and Polymorphism
Refactoring Methods: Kevin Murphy.
CS240: Advanced Programming Concepts
null, true, and false are also reserved.
What is Singleton Category: Creational pattern
Singleton design pattern
Simple Classes in Java CSCI 392 Classes – Part 1.
CSE 341 Section 2 Nick Mooney Spring 2017
Chapter 8 Classes User-Defined Classes and ADTs
CS 350 – Software Design Singleton – Chapter 21
Which best describes the relationship between classes and objects?
COS 260 DAY 4 Tony Gauvin.
slides created by Ethan Apter and Marty Stepp
CIS 110: Introduction to computer programming
Presentation transcript:

Personal Medical Unit Lars Sarbæk Kristiansen Kasper J. Nielsen Martin Kjeldsen

Agenda Last time  Updated classdiagram  First draft of implementation Today  Updated classdiagram  Implementation of selected classes/ops.  Testing with VDMUnit

Updated class diagram Class Clock represents global time

Classes of interest Class Clock  Representation of global time i.e. Need to determine patient records last update Class MedicalDevice Class PMUSystem (main)

Class Clock class Clock instance variables static private time : nat := 0; operations static public GetTime : () ==> nat GetTime() == return time; static public IncrementClock : () ==> nat IncrementClock() == ( time := time + 1; return time ) end Clock

Class MedicalDevice class MedicalDevice... public RetrieveDeviceData : () ==> Data RetrieveDeviceData() == ( def deviceData = mk_Data(deviceId, dataLog) in ( PurgeData(); return deviceData ); ); public CreateDataEntry: seq of char * nat ==> () CreateDataEntry (data, t) == def newLogEntry = mk_LogEntry(t, data) in dataLog := [newLogEntry] ^ dataLog post entryExists(mk_LogEntry(t,data)); (continued->)

Class MedicalDevice (cont.) … public entryExists: LogEntry ==> bool entryExists(logEntry) == for entry in dataLog do if logEntry.timeStamp = entry.timeStamp then return true else return false; public GetLatestEntries: nat ==> seq of LogEntry GetLatestEntries(amount) == return dataLog(1,...,amount) pre amount <= len dataLog post len dataLog(1,...,amount) = amount end MedicalDevice

Class PMUSystem (main) Operation of interest: CollectDataFromDevices class PMUSystem … public CollectDataFromDevices: seq of char ==> () CollectDataFromDevices(patientId) == ( for all pmu in set pmus do ( def patientIdFromRecord = pmu.RetrievePatientRecord().GetPatientId() in ( if (patientIdFromRecord = patientId) then def deviceList = pmu.RetrieveDeviceList() in for all device in set deviceList do pmu.PollDevice(device.GetDeviceId()) ) pre exists pmu in set pmus & pmu.RetrievePatientRecord().GetPatientId() = patientId; end PMUSystem

Testing the PMU System Benefits of the testing process  Discover required functionality Testing with VDMUnit / IO  Testcases Example: MedicalDevice unittest

Test case: MedicalUnit (1) class MedicalDeviceTest is subclass of TestCase … -- Test constructor protected TestInit: () ==> () TestInit() == (dcl mUnit : MedicalDevice := new MedicalDevice(1); AssertTrue(mUnit.GetDeviceId()= 1)); -- Test data entries protected TestDataEntries: () ==> () TestDataEntries() == (dcl mUnit : MedicalDevice := new MedicalDevice(1); mUnit.CreateDataEntry("some medical device data", 1); def lastDataEntry = mUnit.GetLatestEntries(1) in AssertTrue(hd lastDataEntry = mk_MedicalDevice`LogEntry(1,"some data")); ); end MedicalDeviceTest Code from MedicalUnitTest.vpp

Test case: MedicalUnit (3) Code from CompletePMUTest class CompletePMUTest operations public Execute: () ==> () Execute() == ( dcl ts: TestSuite:=new TestSuite(); ts.AddTest(new MedicalDeviceTest("MedicalDeviceTest")); ts.Run() ) end CompletePMUTest

Test case: MedicalUnit (1) Result ok?

Summary Todays presentation  Recap and introduction of new class Clock  Implementation of selected classes/ops.  Testing with VDMUnit What’s next?  Finish polishing off the implementation  Extend test to other units and components  Write down what we’ve learned in a really good report!