Download presentation
Presentation is loading. Please wait.
Published byAllyson Park Modified over 9 years ago
1
By DrinkableMilk 10.29.2008
2
Group Members Chen Qiushi Cen Yunsi Wu Lezhen Lin Yanmei Zhang Chen Zeng Ting
3
Agenda
4
Agenda
5
Task ▫A ▫A Milk Supply Chain ▫Different ▫Different Roles Manager(=Plant), Manager(=Plant), customer, and farmer ▫Interactions ▫Interactions Between Roles: Ordering, Ordering, supplying, producing milk… ▫Sequences ▫Sequences Exist Between Functions
6
Details of Sequences 0. Login in different roles 1. Customer orders some milk to a certain plant 2. Milk plant calculates the volume of milk 3. Milk plant asks milk farmer to supply milk 4. Milk farmer takes time to deliver his milk to milk plant 5. Save the processes above Done!
7
Agenda
8
Task :A Milk Supply Chain ▫Different ▫Different Roles Manager(=Plant), customer, and farmer ▫Interactions ▫Interactions Between Roles: Ordering, Ordering, milking, order processing … ▫Sequences ▫Sequences Exist Between Functions Customer Manager Farmer Milking Ordering Order Processing Login
9
Sequences of functionSequences of function 0. Login in different roles 1. Customer orders some milk to a certain plant 2. Milk plant calculates the volume of milk 3. Milk plant asks milk farmer to supply milk 4. Milk farmer takes time to milk and deliver his milk to milk plant 5. Save the processes above Done!Done! Customer Login Plant Farmer Finishing Milking Ordering OrderToFarmer OrderToPlant Report Milk Processing Initial
10
Customer Login Plant Farmer Finishing Milking Ordering OrderToFarmer OrderToPlant Report Milk Processing Initial
11
Process Model A model with a set of entities and a set of activities scheduled according to particular sequences and particular constraintsA model with a set of entities and a set of activities scheduled according to particular sequences and particular constraints
12
Process Model Design
13
Detailed Process Design ▫Functions ▫ parameters ▫return values… Function Name DescriptionInput parameters Return values… MilkCowGet milk from cows Cow's ID, farmer's money volume of milk HealCowImprove cow's health state cow's ID, heal method Cow's health state level …
14
Process Model Design Function Name DescriptionInput parameters Return values… MilkCowGet milk from cowsCow's ID, farmer's money volume of milk HealCowImprove cow's health state cow's ID, heal method Cow's health state level …
15
Model Design Tools Flow chart Petri net OPN From www.wikipedia.com From www.baidu.com
16
A network of objects and processes connected by relationships, so called OPN(Object - Process - Network) OPN Object Process
17
Farmer Milking Milk
18
Token's key/value Farmer_IDCredit... 1100...
19
Process:do operations Farmer_IDCredit... 1100... Farmer_IDCredit... 190... Farmer_IDCreditMilk_Time... 1900...
20
Conditions:control the flow Farmer Credit>85 Milking Farmer_IDCreditMilk_Time... 1900...
21
Synchronization Farmer Milking Order to Farmer Order to Farmer
22
OPN is not only a descriptive model language, but also an executable model language. Follow this fashion, we specify operations and conditions of the problem. Next we will construct our data model.
23
Agenda
24
Data Model Definition Categories Data model Design
25
Data Model A collection of conceptual tools for description. It describes data, data relationships, data semantics, and consistency constraints. ——From our textbook
26
Based on the application of different levels
27
Data Model Categories
28
Data Model Design
30
Data model comes from the process Data Model Design Two methods for conceptual design Data dictionary E-R model
31
Data Dictionary is a collection of all elements of the process model. It consists of many entries Data Model Design(1) An entry consists of: Name Data description Data source Data type Design constraint Others
32
NameDescriptionSource··· farmer A person makes money by providing milk··· Login··· Stock Order milk, send complaints ··· plant or farmer ··· Order The storage is related to orders··· custome r ··· An simple dictionary Especially when the size of data set becomes larger.
33
ER-Model Data Model Design(2) Customer Plant Farmer MilkOrder Plant_ID Loc_x Plant_ID Loc_x Loc_y Name Loc_y Plant_ID Name Loc_y Loc_x Entity sets Relation sets Attributes
34
Customer Plant Farmer MilkOrder Plant_ID Loc_x Plant_ID Loc_x Loc_y Name Loc_y Plant_ID Name Loc_y Loc_x E-R model is a kind of conceptual design.
35
Data Model Design(3)
36
Relational Design Reduce redundancy Losslessness Dependency preservation
37
Normalization First Normal Form Second Normal Form Third Normal Form Boyce-Codd Normal Form Data Model Design(3)
38
Our achievement
39
Procedures After Design…
40
Agenda
41
Testing is the process of executing a program with the intent of finding errors. —— 《 The Art of Software Testing 》 Glenford J. Myers Definition Of Testing
42
Procedure Of Testing
43
A test case is a set of test data for the program——data the program must handle correctly to be considered a successful program (Smallest component element of source code ) Design of test case Black-Box Testing Also data-driven, or input/output-driven testing White-Box Testing Also logic-driven testing Test Case
44
DrinkableMilk.m (*This function gets the value of a certain key in a certain token. @input:token,key @output:value of the key *) GetTokenValueByKey[token_, key_] :=Block[{valuePosition}, valuePosition = Position[token[[5]], key]; If[valuePosition == {}, Return[Null], Return[Delete[token[[6, Delete[valuePosition, 0]]],0]] ]; ] What we’re only concerned with Unit Testing Using Munit(1/2)
45
DrinkableMilk.mt token = { “”, “”, { “type”, “number”, “time”, “price”, “customer” }, { "A", "1", "3", "10", "B“ } }; Test[ GetTokenValueByKey[token, "number"] ‘ "1“ ‘ TestID->"DrinkableMilk-20081026-Q0Z1O9" ] Key Value Judgement:( if in Java language :) AssertTrue(GetTokenValueByKey[token, "number"] ==1”) Unit Testing Using Munit(1/2)
46
46 Obje ct PreconditionProcessPostcondition Objec t * “OrderAmount ”>5 OrderProcesso r “CustomerMoney ” Decreases by 5×unit price * precondition GetTokenValueByKey[token,“Order Amount“] Postcondition GetTokenValueByKey[token,“OrderA mount“] How to test pre/post conditions
47
SaveIntoDB _Finish
48
System testing Database Before Running Print out the Running Result (in computer memory) Database After Running
49
Comparison Results: Get["DrinkableMilk`DrinkableMilk`"]; RunGraph["1",OPNGraph,200,PR® True]; Barrierlogin {355118,0,{Iss,Pre-1},{275854},{},{}} 0 BarrierProcessing {979397,0,{Plant,Pre-4},{877581},{tokenType,plantID,volume,locX,locY},{PLANT,2,15.0,45.0,81.0}} 0 BarrierProcessing {554280,0,{OrderToPlant,Pre- 3},{263933},{customerID,demand,farmerID,locX,locXC,locXP,locY,locYC,locYP,need,plantID,tokenType,totalTime},{5,23,NULL,21.,NU LL,NULL,21.,NULL,NULL,NULL,NULL,ORDER,NULL}} &&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&7 0 BarrierMilking {563776,0,{Farmer,Pre-6},{711},{tokenType,farmerID,speed,locX,locY},{FARMER,4,14.0,65.0,43.0}} BarrierProcessing {554280,0, {OrderToPlant,Pre3},{263933}, {customerID,demand,farmerID,OrderID, plantID,totalTime}, {5,23,4,69,2,35399200}}
50
New Tuple added
51
Agenda
52
Background: Application of Dairy Farm System Whole process from design to development ▫Step 1: Client v.s. DrinkableMilk Development Group (DDG) Client puts forward their demands Review
53
▫Step 2: DDG deals with the demands Build up conceptual process model ▫Step 3: design the detailed process model Functions, parameters, return values… DDG will generate a … ▫Step 4: Data Model Design (ER Model) Establish conceptual Model and optimize using… ▫Step 5: Mapping to Relational data model
54
Process model (NET) Activities(NODE) Int CalculatingTime() Int CalculatingDist() … Functions (DETAILS) Client’s Demand Client’s Demand
55
Process+Data Model Activities Functions
56
▫Step 6: Implementation and Unit test Independently Separately ▫Step 7: Integration test & System test Review
57
Miserable experience before ▫Coding without thinking before ▫Unclear steps for working on a project. A new method ▫Process Model and Data Model ▫Design and Development Begin with Process in mind
58
THANKS ▫By DrinkableMilke Group ▫2008-10-29
Similar presentations
© 2025 SlidePlayer.com Inc.
All rights reserved.