Tải bản đầy đủ (.pdf) (61 trang)

QUIZ 3 Fresher Unit test

Bạn đang xem bản rút gọn của tài liệu. Xem và tải ngay bản đầy đủ của tài liệu tại đây (846.36 KB, 61 trang )

Part 1 of 1 -

Question 1 of 20

78.33/ 100.0 Points
5.0/ 5.0 Points

………. Developer reviews code for accuracy

A.Design check
B.Requirement check
C.Technical check
D.Desk checking

Question 2 of 20

5.0/ 5.0 Points

………It is a review where the author lead team through a manual or a simulated execution of
the product using predefined scenarios

A.technical reviews
B.inspection
C.walkthrough
D.checklist

Question 3 of 20

5.0/ 5.0 Points

Khi viết white box test case, chỉ cần viết đầy đủ số lượng test case thỏa statement coverage thì


số test case đó đã thỏa điều kiện branch coverage

True
False
Question 4 of 20

What are the items that have to have in unit test case

3.33/ 5.0 Points


A. Input data
B. Test case description
C. Expected result
D. The actor that take the test

Question 5 of 20

"Cho đoạn code sau :
public bool ValidateEmail(string strEmail)
{
//Check null or empty
if (string.IsNullOrEmpty(strEmail))
{
return false;
}
//Check required character
bool blnRequireChar = false;
for (int i = 0; i < strEmail.Length; i++)
{

if (strEmail[i].ToString().Equals(""@""))
{
blnRequireChar = true;
}
}
//Check incorrect character
for (int i = 0; i < strEmail.Length; i++)
{
if (char.IsLetterOrDigit(strEmail[i]))
{
continue;
}
else if(char.Equals('.',strEmail[i]) || char.Equals('@',strEmail[i]))
{
continue;
}
else
{
return false;
}

0.0/ 5.0 Points


}
return true;
}
Đoạn code trên cần ít nhất bao nhiêu test case?"

A.5

B.7
C.8
D.6

Question 6 of 20

5.0/ 5.0 Points

Regardless of whether a review is called an inspection or a walkthrough, it is a systematic
approach to examining source code in detail

True
False
Question 7 of 20

5.0/ 5.0 Points

A unit is the smallest testable part of an application (In procedural programming a unit may be
an individual program, function, procedure, etc., while in object-oriented programming, the
smallest unit is always a method)

True
False
Question 8 of 20

5.0/ 5.0 Points

Bước Equivalence partitioning của Black Box Test bao gồm những việc nào sau đây

A. Anticipate that errors are most likely to exist at the boundaries between partitions

B. A limited number of representative test cases should be chosen from each partition


C. Behavior of software is equivalent for any value within particular partition
D. Divide the input of a program into classes of data from which test cases can be
derived. This might help you to reduce number of test cases that must be developed.

Question 9 of 20

5.0/ 5.0 Points

The exact scope of a unit is left to interpretation. Supporting test code , sometimes called
………., may be necessary to support an individual test.

A.All of above
B.Conjucture
C.RemUnit
D.Scaffolding

Question 10 of 20

0.0/ 5.0 Points

The most common approach to unit testing require drivers and stubs to be written

True
False
Question 11 of 20

5.0/ 5.0 Points


What's is "Decision coverage" ?

A.Each branch in the logic visited by a test
B.Each path through the logic is visited by a test
C.Each statement in the program will be visited by test

Question 12 of 20

5.0/ 5.0 Points


Unit Testing Conductor là Testing team

True
False
Question 13 of 20

0.0/ 5.0 Points

Which of the following is appropriate as a description of boundary value analysis?

A.A method where boundary values are identified for the data entered into the system and
used as test data
B.A method where equivalence class border values are used as test data
C.A method of analysis for identifying input values that do not produce errors but are on
the borderline
D.A method of testing where boundary values that can be entered into the system are
analyzed


Question 14 of 20

5.0/ 5.0 Points

A black box test is a type of testing technique used in software development. Which of the
following statements accurately describes a black box test?

A.A black box test is based on the internal specifications that describe the internal
structure and logic of the program. It is mainly performed by the program developer
him/herself.
B.The objective of a black box test is to execute all of the instructions in the program at
least once. It is mainly performed by the program developer him/herself.
C.A black box test analyzes the source program and tests program control flow and the
flow of data such as variables. It is mainly performed by third parties and not by the program
developer.


D.A black box test tests whether or not the program functions as the designer intended. It
is mainly performed by third parties and not by the program developer.

Question 15 of 20

5.0/ 5.0 Points

……. A series of probing question designed to review a predetermined area or function

A.Meeting list
B.Checklist
C.Minutes
D.Plan list


Question 16 of 20

5.0/ 5.0 Points

Unit testing is commonly automated, but cannot still performed manually?

True
False
Question 17 of 20

5.0/ 5.0 Points

……… reviews: Review conducted during the system development process, normally in
arccodance with system development methodology. The primary objective of design reviewes is
to ensure compliance to design methodology.

A.Technical
B.Design
C.Requirement
D.Process


Question 18 of 20

0.0/ 5.0 Points

Unit Test should be conducted for each module (class or function) after code review has been
done


True
False
Question 19 of 20

5.0/ 5.0 Points

……….. Review. A review process that uses peer to review that aspect of the systems
development life cycle with wich they are the most familiar. Typically the ……reviews offer
compliance to standard, procedures, guidelines, and the use of good practices, as opposed to
efficiency, effectiveness, and economy of the design and implementation

A.Technical
B.Peer
C.Requirement
D.Design

Question 20 of 20

5.0/ 5.0 Points

Unit Testing is to validate that individual units of software program are working properly.

True
False

Question 1 of 20
What's is "Decision coverage" ?

5.0/ 5.0 Points



A.Each branch in the logic visited by a test
B.Each statement in the program will be visited by test
C.Each path through the logic is visited by a test
0.0/ 5.0 Points

Question 2 of 20
The two major quality assurance verification approaches for each life cycle phase are ………

A.Technical check
B.Requirement check
C.Technical review
D.Design check

Question 3 of 20
Unit test is implemented by Development team to

1.67/ 5.0 Points

A. Reduce the Quality Effort & Correction Cost
B. Create related documents: Unit Test cases, Unit Test Reports, …
C. Detect defects and issues early
D. Ensure quality of software unit
0.0/ 5.0 Points

Question 4 of 20
Which of the following is the appropriate description concerning standardization in programming?


A.It is effective for clarifying the standard execution time of a program to promote the

creation of efficient programs.
B.Its purpose is to define rules about common items that are independent of programming
languages.
C.Its original purpose is not to limit an individual programming style, but to easily
achieve the effect of optimization provided by a compiler.
D.Defining programming conventions is effective for preventing errors that programmers
tend to make.

Question 5 of 20
"The below function calculate square of number

5.0/ 5.0 Points

Public static integer Square (integer intNumber){
Try
If input<0 THEN
Print error message ""Square root error – illegal negative input""
RETURN 0
ELSE_IF input=0 THEN
RETURN 0
ELSE
Use square function to calculate the answer
RETURN the answer
END_IF
Catch
Print error message “The system error”
End Try
}
How many test cases used for branch test ?"


A.3
B.2
C.4
D.1

Question 6 of 20

5.0/ 5.0 Points


To ensure testing robustness and simplify maintenance, test should never rely on other test nor should
they depend on the ordering in wich test are executed?

True
False
5.0/ 5.0 Points

Question 7 of 20
Unit Test should be conducted for each module (class or function) after code review has been done

True
False
Question 8 of 20
"Unit Testing Deliverables bao gồm
- Tested software units
- Related documents (Unit Test case, Unit Test Report)"

5.0/ 5.0 Points

True

False
5.0/ 5.0 Points

Question 9 of 20
Which of the following is the appropriate point to focus when preparing test data for a white box test?

A.Program input and output relationship
B.Program functions
C.Program internal structure such as algorithm
D.Boundary value for each equivalence class obtained through the application of
equivalence partitioning

Question 10 of 20
"public bool ValidPassword(string password)
{
bool validPassword = false;
// Check valid password length

5.0/ 5.0 Points


if(IsValidLength(password, minLength, maxLength))
{
validPassword = true;
// Check valid password mix between lowcase and upcase
if(!IsMixedCase(password))
return false;
// Check valid password mix between alpha & numeric
if(!IsAphaNumeric(password))
return false;

}
return validPassword;
}
How many unit test cases you must do to check this function to cover all path! "

A.3
B.5
C.6
D.4

Question 11 of 20
Bước Equivalence partitioning của Black Box Test bao gồm những việc nào sau đây

5.0/ 5.0 Points

A. Behavior of software is equivalent for any value within particular partition
B. Divide the input of a program into classes of data from which test cases can be
derived. This might help you to reduce number of test cases that must be developed.
C. Anticipate that errors are most likely to exist at the boundaries between partitions
D. A limited number of representative test cases should be chosen from each partition
5.0/ 5.0 Points

Question 12 of 20
The exact scope of a unit is left to interpretation. Supporting test code , sometimes called ………., may
be necessary to support an individual test.


A.Conjucture
B.Scaffolding
C.All of above

D.RemUnit

Question 13 of 20
uncoupled, uncohesive

0.0/ 5.0 Points

A.uncoupled, cohesive
B.decoupled, cohesive

C.uncoupled, uncohesive
D.decohesive, coupled
0.0/ 5.0 Points

Question 14 of 20
Unit test should be written without explicit knowledge of the environment context in wich they are
executed co that they can be run anywhere at anytime

True
False
Question 15 of 20
"Cho đoạn code sau :
public bool ValidateEmail(string strEmail)
{
//Check null or empty
if (string.IsNullOrEmpty(strEmail))
{
return false;
}
//Check required character

bool blnRequireChar = false;

5.0/ 5.0 Points


for (int i = 0; i < strEmail.Length; i++)
{
if (strEmail[i].ToString().Equals(""@""))
{
blnRequireChar = true;
}
}
//Check incorrect character
for (int i = 0; i < strEmail.Length; i++)
{
if (char.IsLetterOrDigit(strEmail[i]))
{
continue;
}
else if(char.Equals('.',strEmail[i]) || char.Equals('@',strEmail[i]))
{
continue;
}
else
{
return false;
}
}
return true;
}

1. Is this function can check correctly email?"

A.No
B.Yes

Question 16 of 20
"There are two types of unit test case:
Black box unit test case and White box unit test case"

0.0/ 5.0 Points

True
False
5.0/ 5.0 Points

Question 17 of 20
What types of errors are missed by black box and testing and can be uncovered by white box testing?

A."behavioral errors
"


B."subtle logic errors
"
C."performance errors
"
D.input errors
0.0/ 5.0 Points

Question 18 of 20

A black box test is a type of testing technique used in software development. Which of the following
statements accurately describes a black box test?

A.A black box test tests whether or not the program functions as the designer intended. It
is mainly performed by third parties and not by the program developer.
B.A black box test analyzes the source program and tests program control flow and the
flow of data such as variables. It is mainly performed by third parties and not by the program
developer.
C.The objective of a black box test is to execute all of the instructions in the program at
least once. It is mainly performed by the program developer him/herself.
D.A black box test is based on the internal specifications that describe the internal
structure and logic of the program. It is mainly performed by the program developer
him/herself.
0.0/ 5.0 Points

Question 19 of 20
When software is developed using a test driven-approach, the unit test may take a place of …….. Each
unit test can be seen as a design element specifying classes, method and observable behavior.

A.unique design
B.informal design
C.both A & B


D.formal design

Question 20 of 20
What are the items that have to have in unit test case

1.67/ 5.0 Points


A. The actor that take the test
B. Expected result
C. Input data
D. Test case description

____HCMUT_013_CSD_02_Quiz3_Unit Testing
Return to Assessment List

Part 1 of 1 -

83.33/ 100.0 Points

5.0/ 5.0 Points
The exact scope of a unit is left to interpretation. Supporting test code , sometimes called
………., may be necessary to support an individual test.
Question 1 of 20

A.Scaffolding
B.Conjucture
C.RemUnit


D.All of above
5.0/ 5.0 Points
……… reviews: Review conducted during the system development process, normally in
arccodance with system development methodology. The primary objective of design reviewes
is to ensure compliance to design methodology.
Question 2 of 20


A.Requirement
B.Technical
C.Design
D.Process
5.0/ 5.0 Points
White Box Test phải đảm bảo hoàn thành các yêu cầu nào sau đây?
Question 3 of 20

A. Decision (branch) coverage
B. Boundary value coverage
C. "Statement coverage
"
D. Path coverage
0.0/ 5.0 Points
Which of the following is an appropriate statement in regard to a module unit test?
Question 4 of 20

A.Generally, test cases are created and executed by dedicated testing staff, not
programmers who have done the coding.


B.Verification should be performed, in principle, using test cases which cover all the
logic paths at least once while reviewing the module design documents.
C.The module interface falls outside the scope of the unit test because the module
interface cannot be tested using a single module.
D.The module design documents have already been verified. If a problem is found in the
test results, an error exists in the test case or the module.
5.0/ 5.0 Points
Unit Test should be conducted for each module (class or function) after code review has been
done

Question 5 of 20

True
False
5.0/ 5.0 Points
The most common approach to unit testing require drivers and stubs to be written
Question 6 of 20

True
False
5.0/ 5.0 Points
Regardless of whether a review is called an inspection or a walkthrough, it is a systematic
approach to examining source code in detail
Question 7 of 20

True
False
5.0/ 5.0 Points
The two major quality assurance verification approaches for each life cycle phase are ………
Question 8 of 20

A.Requirement check
B.Design check


C.Technical review
D.Technical check
5.0/ 5.0 Points
What types of errors are missed by black box and testing and can be uncovered by white box
testing?

Question 9 of 20

A."behavioral errors
"
B."subtle logic errors
"
C.input errors
D."performance errors
"
Question 10 of 20

0.0/ 5.0 Points

uncoupled, uncohesive

A.decoupled, cohesive

B.uncoupled, uncohesive
C.uncoupled, cohesive
D.decohesive, coupled
5.0/ 5.0 Points
Technical review are more …….. That is, they aim to remove defects as soon as possible.
Question 11 of 20


A.Preventive
B.Objective
C.Subjective
D.Descriptive
5.0/ 5.0 Points

Khi viết white box test case, chỉ cần viết đầy đủ số lượng test case thỏa path coverage thì số
test case đó đã thỏa điều kiện branch coverage
Question 12 of 20

True
False
Question 13 of 20

5.0/ 5.0 Points

What's is "Decision coverage" ?

A.Each branch in the logic visited by a test
B.Each statement in the program will be visited by test
C.Each path through the logic is visited by a test
5.0/ 5.0 Points
In static unit testing, code is reviewed by applying techniques commonly known as ……..
Question 14 of 20

A. technical reviews
B. inspection
C. checklist


D. walkthrough
Question 15 of 20

0.0/ 5.0 Points

An inspection process is characterized by:


A. Roles (who are inspector?)
B. Process (How do the inspector organse their work?)
C. Reading techniques (how are artifacts examined?)
D. Both A & B
5.0/ 5.0 Points
Unit test should be written without explicit knowledge of the environment context in wich they
are executed co that they can be run anywhere at anytime
Question 16 of 20

True
False
3.33/ 5.0 Points
Please select the test case design techniques that used to create unit test spec
Question 17 of 20

A. Internal boundary value testing
B. Branch Testing
C. Condition testing
D. State transition testing
5.0/ 5.0 Points
Unit Testing is to validate that individual units of software program are working properly.
Question 18 of 20


True
False
5.0/ 5.0 Points
A black box test is a type of testing technique used in software development. Which of the
following statements accurately describes a black box test?

Question 19 of 20

A.A black box test tests whether or not the program functions as the designer intended. It
is mainly performed by third parties and not by the program developer.
B.A black box test is based on the internal specifications that describe the internal
structure and logic of the program. It is mainly performed by the program developer
him/herself.
C.The objective of a black box test is to execute all of the instructions in the program at
least once. It is mainly performed by the program developer him/herself.
D.A black box test analyzes the source program and tests program control flow and the
flow of data such as variables. It is mainly performed by third parties and not by the program
developer.
5.0/ 5.0 Points
……….. Review. A review process that uses peer to review that aspect of the systems
development life cycle with wich they are the most familiar. Typically the ……reviews offer
compliance to standard, procedures, guidelines, and the use of good practices, as opposed to
efficiency, effectiveness, and economy of the design and implementation
Question 20 of 20

A.Requirement
B.Design
C.Technical
D.Peer


____HCMUT_013_CSD_02_Quiz3_Unit Testing
Return to Assessment List

Part 1 of 1 -


65.83/ 100.0 Points

3.33/ 5.0 Points
Black box testing attempts to find errors in which of the following categories:
Question 1 of 20

A. incorrect or missing functions
B. interface errors
C. performance errors
2.5/ 5.0 Points
Các best practice của giai đoạn Perform unit testing bao gồm
Question 2 of 20

A. Test each feature once
B. Unit tests should be fully automated and non-interactive
C. Keep tests independent
D. Keep unit tests small and fast
Question 3 of 20

5.0/ 5.0 Points

Unit Testing Conductor là Testing team

True
False
5.0/ 5.0 Points
"The below function calculate square of number
Question 4 of 20



Public static integer Square (integer intNumber){
Try
If input<0 THEN
Print error message ""Square root error – illegal negative input""
RETURN 0
ELSE_IF input=0 THEN
RETURN 0
ELSE
Use square function to calculate the answer
RETURN the answer
END_IF
Catch
Print error message “The system error”
End Try
}
How many test cases used for branch test ?"

A.1
B.3
C.2
D.4
5.0/ 5.0 Points
Which of the following is the appropriate point to focus when preparing test data for a white
box test?
Question 5 of 20

A.Boundary value for each equivalence class obtained through the application of
equivalence partitioning
B.Program functions
C.Program input and output relationship

D.Program internal structure such as algorithm


5.0/ 5.0 Points
……… reviews: Review conducted during the system development process, normally in
arccodance with system development methodology. The primary objective of design reviewes
is to ensure compliance to design methodology.
Question 6 of 20

A.Requirement
B.Technical
C.Design
D.Process
5.0/ 5.0 Points
Bước Specification derived test của Black Box Test bao gồm những việc nào sau đây
Question 7 of 20

A. Execute test cases to check test result will output as the specification
B. Test the software at either side of boundary values
C. Create test cases for each statements of specification
D. Divide the input of a program into classes of data from which test cases can be
derived. This might help you to reduce number of test cases that must be developed.
5.0/ 5.0 Points
Please select the test case design techniques that used to create unit test spec
Question 8 of 20

A. Internal boundary value testing
B. Branch Testing
C. Condition testing



D. State transition testing
5.0/ 5.0 Points
White Box Test phải đảm bảo hoàn thành các yêu cầu nào sau đây?
Question 9 of 20

A. Decision (branch) coverage
B. Boundary value coverage
C. "Statement coverage
"
D. Path coverage
5.0/ 5.0 Points
What are the items that have to have in unit test case
Question 10 of 20

A. Expected result
B. Input data
C. The actor that take the test
D. Test case description
0.0/ 5.0 Points
Internal and unit testing can be automated with the help of ….. Tools.
Question 11 of 20

A.testing
B.coverage
C.scaffolding


Tài liệu bạn tìm kiếm đã sẵn sàng tải về

Tải bản đầy đủ ngay
×