Code Review In Testing View

Post on 22-Apr-2015

1,419 views 2 download

description

SQABD Lightning Talks 3 www.sqabd.com

transcript

Company

LOGO

Md. Rizwanur Rashid

Enosis Solutions[http://www.rizviews.com]

Code Review in [Testing View]

A quotation…………….

“Testers can partner with developers to strengthen unit tests, participate in code reviews and inspections, and better understand where to focus their ‘testing attention’ based on a more in-depth analysis of the system.”

-Bj Rollison-Test Architect, Microsoft[Source: Interview of Bj Rollison]

Code Review

Code Review in Testing View….

Devs will perform their part of review. We’ll perform some additional, such as:

Identify code blocks which may create crashing bug!

Identify code blocks which may increase execution time (performance issue!).

Identify code blocks which may cause memory leaking.

Database inconsistencies Cosmetic Issues

Example: Read File

StreamReader re = File.OpenText(“file.txt”);

string input = null;

input = re.ReadLine();

while ((input=re.ReadLine())!=null)

{

}

re.close();

Will always skip first line!!

Functional flaw which identified earlier!

Example: Database Connection

SQLConnection con = new SQLConnection();<Initilizing object con>con.open();<Blah; blah; whatever!><End of coding!>

try{ SQLConnection con =new SQLConnection(); <Initilizing object con> con.open(); <Blah; blah; whatever!> <End of coding!>}catch{}finally{ con.close();}

Example: Try-Catch

class foo1(){

foo1(){

foo2();}void foo2(){

try{

………..;}catch (Exception exp){

throw exp;}

}}

class foo1(){

foo1(){

try{foo2();}catch (Exception ex){whatever!}

}void foo2(){

try{

………..;}catch (Exception exp){

throw exp;}

}}

Example: Null Check

Better to perform Empty/null checking.

void foo(){string var1;------------------------if(!string.IsNUllOrEmpty(var1) do something;

}

Example: Database

Database Objects Convension

SP Parameter and Column Length/DataType

Usage of Index [Performance Issues]

Usage of SubQuery/Join [Performance Issues]

tblUsers

UserName: varchar(10)

usp_CreateUser

UserName: varchar(8)

So…..

So, we need programmer as testing

guy now?- BIG NO!!

Distribute task accordingly.

Advantages

Attached with development procedures from early stage.

Thus gain more knowledge on implementing requirements.

Helps in quick bug tracing. Also helps testing guys to be more:

Skilled Analytical Efficient

QA [not Quality Assurance it’s Question Answer..]