Lecture 7 - Building the Product
Lecture 7 - Building the Product CS2103
Popular in Software Engineering
Popular in Quantitative Methods
ANTH 150 B1
verified elite notetaker
This 3 page Class Notes was uploaded by Jerry Tan on Friday October 9, 2015. The Class Notes belongs to CS2103 at National University of Singapore taught by Damith C. Rajapakse in Summer 2015. Since its upload, it has received 25 views. For similar materials see Software Engineering in Quantitative Methods at National University of Singapore.
Reviews for Lecture 7 - Building the Product
Report this Material
What is Karma?
Karma is the currency of StudySoup.
Date Created: 10/09/15
National University of Singapore NUS CS2103 Software Engineering AY2015 SEM 1 Lecture 7 Building the Product Friday 9th October 2015 By Jerry Tan Si Kai C82 103 Software Engineering Lecture 7 Coupling and Cohesion Software Reuse Analogy Can you become a good poet by not reading other poet s poems It is okay to reuse others code to learn from them How to find good code to learn from From internships jobs Code is just good enough because the developers are under timepressure Opensourced projects best developers contribute there there is no time pressure and it is public so they must maintain highest standard of coding Intermediate SE knowledge L7 L13 Coupling and Cohesion to tighten or loosen Given 2 components A and B A calls foo in B If I change B will it require a change in A If yes there is strong dependency Eg A calls foo in B If maybe there is weak dependency Eg Both A and B writes to a Global Variable Good component design reduce coupling increase cohesion Why increase cohesion the component is reusable can be removed and plugged in to another project Easier to maintain Inverse relationship between coupling and cohesion decrease coupling will increase cohesion and vice versa Developertodeveloper documentation For developer as user For developer as maintainer Do s and Don ts 1 just enough docs not as much as possible 2 Topdown not bottomup 3 Generate docs from code 4 Comprehensible and comprehensive 5 Remember the purpose don t just add many class diagrams just because it is required Putting up defenses to protect your code from other people s mistakes 1 Misunderstandings a Use assertBoolean expression to check that your assumptions hold during runtime Will fail and crash the program immediately once the assumption fails to notify the programmer that there is a bug b If developer screwed up it is a bug and should crash the program immediately 2 Mishaps a User mishaps something stupid that the user has done so we should handle or raise exceptions b If user screws up thow errors or exceptions which can be handled 3 Mysteries a Logging print variable values to the console or a log file 4 Misuse a Actively identify holes and plug them b Bertrand Meyer Design by Contract and the Eiffel language Allows programmer the ability to specify the PROMISE and the runtime environment to check that