Difference Between Coupling and Cohesion
Difference Between Coupling and Cohesion
5. briefly explain an incremental coding process test driven development and pair programing
- An Incremental Coding Process : Write code for the module, unit test it, fix the bugs
▪It is better to do this incrementally – write code for part of functionality, then test it and fix it, then proceed
- Test Driven Development ▪ programmer first writes the test scripts and then writes the code to pass the test
cases in the script
- Pair Programming ▪Code is written by pair of programmers rather than individuals
6. least and explain at list three common coding errors that need to be avoided
- Memory Leaks- A memory leak is a situation, where the memory is allocated to the program which is not
freed subsequently
- Freeing an Already Freed Resource- Programmer tries to free the already freed resource
- NULL Dereferencing - Occurs when we access a location that points to NULL
- Lack of Unique Addresses - Aliasing creates many problems among them is violation of unique addresses
when we expect different addresses.
- Synchronization Errors - Possible when there are multiple threads which are accessing some common
resources, in a parallel program
- Buffer overflow - It is a security vulnerability, can be exploited by executing arbitrary code by a malicious
user
7. draw class diagram for queue
Queue
{private} front: int
{private} rear:int
{readonly} MAX:int
{public} add(element:int)
{public}remove():int
{protected}isEmpty():boolean