100 likes | 105 Views
Learn how to model and enforce constraints in JMermaid for teacher reviews. Test positive and negative cases to see constraint enforcement in action. Model additional constraints and explain their implementation.
E N D
TeacherReviews Constraints
Assignment • Download the EDG from the cases website • Look at the OET and explain • Model the constraints in JMermaid • Test your model to see how constraints are enforced in the application. Perform both a positive test (where instances satisfy the constraints) and a negative test (where instances violate the constraint). • Explain how would you model the additional constraints
Explain why… • two faculties are involved in TeachingAssignment events • three faculties are involved in Reviewer events • two people are involved in reviewer events
Explain why… • two faculties are involved in TeachingAssignmentevents
Explain why… • three faculties are involved in Reviewer events
Explain why… • two people are involved in reviewer events
Model the following constraints in JMermaid • A person can only teach courses from his/her own faculty
Model the following constraints in JMermaid • A person can only review teaching assignments from colleagues from his/her own faculty.
How would you express the following constraints? • A person can never be a reviewer of his/her own teaching assignments Invariant Reviewerself.Reviewer_TeachingAssignment.TeachingAssignment_FacultyMember.FacultyMember_Person <> self.Reviewer_FacultyMember.FacultyMember_Person
How would you express the following constraints? • At the moment of the review assignment, the person who is assigned as reviewer for a teaching assignment should have a higher rank than the person being reviewed. Precondition EV_cr_Reviewerself.Reviewer_FacultyMember.FacultyMember_Person.Rank > self.Reviewer_TeachingAssignment.TeachingAssignment_FacultyMember.FacultyMember_Person.Rank If this constraint would be modelled as an invariant, a person would not be able to earn a higher rank when review assignments exists.