Monday, March 15, 2010

Multi-Threading

As user's run-time needs keeps on increasing, it becomes imperative to design effective models where multiple concurrent tasks can be successfully accomplished. One set of possibilities already exists in terms of creating multiple processes running at the same time. Withn 1 process, multiple threads are used to used to devise parallelism. This phenomenon is highly applied in case of network processors. One good link:

http://www.wedevblog.com/posix-threads-threading-with-c.html


As previous posts have already emphasized on these concepts, today's post focusses on testing multithreaded applications.

Reference for this post is:
Object-Oriented Multithreading Using C++ by Cameron Hughes and Tracey Highes
http://www.amazon.com/gp/product/0471180122/ref=cm_li_v_cs_d?tag=linkedin-20


 2 important testing guidelines shared by them:
 -Don't wait until a software system gets complex before testing it
 -Categorize the types of defects to which the software is subject

Unit Testing - Requires that SW be tested one component or unit at a time

Stress Testing - Designed to push a component or a system up to and sometimes beyond its limits

Integration Testing - Used to test the assembly of components. The components are combined into logical groups, and each group is tested as a unit

Regression Testing - Used to retest modules that have changed.Regression tests ensure that the changes to the component do not cause it to lose any functionality

Operational Testing - Used to test the system in its full operation. The operation tests also serve to determine how the component will behave in a totally foreign environment.

Specification Testing - The component is audited against the original specification, used as part of the software verification process.

Acceptance Testing - Used by the end user of the module, component or system to determine performance.

Lets also try to understand several typical categories of software defects that are specific to programs that contain multithreading, concurrency, parallelism or asynchronous process:

Race Condition - Occurs when two or more threads or processes are attempting to modify the same block of shared modifiable data simultaneously.

Deadlock - A thread or process is waiting for an event that will not occur.

Priority Inversion - Occurs when a lower priority thread blocks the execution of a higher priority thread when synchronization variables are being used or when competing for resources.

Performance Degradation - Occurs when a system's performance lowers or degrades in terms of responsiveness, execution time, calculation of results, and so on.

Indefinite Postponement - Occure when a system indefinitely delays the scheduling of processes or threads while other processes or threads receive the attention and the allocation of resources.

Mutex Exhaustion - Occurs when a system has reached its maximum number of mutexes that can be created.

Thread Exhaustion - Occurs when a system has reached its maximum number of threads that can be allocated.


Quiz:
http://testertested.qualityfrog.com/
http://www.informit.com/articles/article.aspx?p=412922&seqNum=4

I scored pretty bad  in the first!

No comments:


Mindbox