Download as xlsx, pdf, or txt
Download as xlsx, pdf, or txt
You are on page 1of 15

Issue No

1
2
3
4
5
In the outer loop, the condition should be i < ar.length instead of i <= ar.length, as array indices start from 0 and go up to l
The variable j is not initialized before using it in the inner loop. It should be initialized as int j = 0.
The inner loop should iterate until j < i instead of j <= i, as you want to sum all the elements before the current index i.
The if statement should use the equality operator (==) rather than the assignment operator ( = ) to compare ar[j]%2 with digi
In the inner loop, the update statement increments i instead of j. This will cause an infinite loop as the value of j never chan
Description Detail
5 Index out of bounds
9 Uninitialized variable
9 Array index incorrect
10 Assignment instead of comparison
5 Infinite loop
Quy ước chấm điểm:
- Chỉ cần tối thiểu một test case để đạt 100% statement coverage và tối thiểu ba test case để đạt 100% bra
- Mỗi test case tương đương 1 điểm. Một test case đúng khi có đủ Input và Return đúng. Sinh viên viết nh
- Thiếu các thông tin như fucntion code, fucntion nam, created by, LOC, Type có thể xem xét trừ 0.1 điểm.
- Sinh viên nhập thông tin executed date, pass/fail có thể xem xét trừ 0.1 điểm

Function Code vicDiff Function Name


Created By Lê Văn Tám Executed By
Lines of code 21 Lack of test cases
Test requirement <Brief description about requirements which are tested in this function>
Passed Failed Untested
8 2 0

UTCID01

UTCID02

UTCID03

UTCID04

UTCID05
Condition Precondition
N/A

Input condition
ar 1
{1} O
null O
{} O
{1, 2} O
{1, 1} O
{1, 2, 3}
{1, 2, 2}
{1, 1, 2, 2}

{1, 2, 1, 2}
{1, 2, 0, 2}

Confirm Return
Output{1} O
Null
Output{1, 2} O O
Output{1, 2, 4}
Output{1, 2, 2, 4}
Exception
O O
Log message
Result Type(N : Normal, A : Abnormal, B : Boun N A N N N
Passed/Failed P F F P P
Executed Date
Defect ID

* Notes: Blue text is sample, needed to be deleted in the answer


Don't edit the grey cell
test case để đạt 100% branch coverage như ví dụ bên dưới.
n đúng. Sinh viên viết nhiều hơn 3 test case cũng không bị trừ điểm.
thể xem xét trừ 0.1 điểm.

vicDiff

-1

N/A/B Total Test Cases


9 1 0 10
UTCID06

UTCID07

UTCID08

UTCID09

UTCID10

O
O
O
O
O

O O
O O O
N N N N N
P P P P P
Quy ước chấm điểm:
- Test analysia 2 điểm: Mỗi condition đúng tương đương 0.4 điểm, trong một condition, mỗi VP, IP, VB, IB tương đư

Table 3.1 Test Analysis


Condition Valid Partitions Tag Invalid Partitio Tag

"Tên sản phẩm"

"Tên nhà cung cấp"


1-100 VP1 <1 IP1
"Số lượng" >100 IP2
not a number IP3
1-10000000 VP2 <1 IP4
"Giá nhập" >10000000 IP5
not a number IP6
0-250 char VP3 >250 char IP7
“Ghi chú”

“Nhập hàng từ khách”

* Notes: Blue text is sample, needed to be deleted in the answer


Quy ước chấm điểm:
tion, mỗi VP, IP, VB, IB tương đương 0.1 điểm. - Design test case 1 điểm: Mỗi

st Analysis
Valid Boundaries Tag Invalid BoundarTag Test-case No
1

"Bình công nghiệp 48kg" VB1


"Bình dân dụng 12kg" VB2 2
"Bình dân dụng 6kg" VB3 3
"Gas South" VB4 4
"Gas petrolimex" VB5 5
1 VB6 null IB1 6
100 VB7 0 IB2 7
101 IB3 8
1 VB8 null IB4 9
10000000 VB9 0 IB5 10
1000001 IB6
null ( 0 char) VB10 251 chars IB7
250 chars VB11
"Checked" VB12
"Unchecked" VB13
y ước chấm điểm:
esign test case 1 điểm: Mỗi test case design được tương đương 0.1 điểm. Test case cần đảm bảo đủ 3 thông tin ở các code LMN

Table 3.2 Test case design


Description Expected result
"Tên sản phẩm": "Bình công nghiệp 48kg"
a new product is successfully imported
"Tên nhà cung cấp": "Gas South"
"Số lượng": "2"
"Giá nhập" "2000"
"Ghi chú" : "sale"
"Nhập từ khách hàng" : Checked

"Tên sản phẩm": "Bình dân dụng 12kg" "Số lượng" : is required number
"Tên
"Tên nhà cung cấp":
sản phẩm": "Gas
"Bình dânSouth"
dụng 6kg" "Số "Giálượng":
nhập" :greater than00but
greater than butnot
notexceeding
exceeding100.
10.000.000
"Tên
"Tên nhà cung
sản phẩm":cấp": "Gas South"
"Ghi chú": "Lorem"Bình dân
ipsum dụng
dolor sit12kg"
amet,"Giá nhập": greater
consectetur thanelit.
adipiscing 0 but not porttitor,
Fusce exceedinglibero
10.000.00
vel laoreet vestibulum, felis tortor c
"Tên
"Nhậpnhà
từ cung
kháchcấp": "Gas
hàng": petrolimex"
Checked "Số lượng" is required a number
"Ghi chú":
"Nhập
"Ghi từ khách
chú": "OK" hàng": Checked "Số lượng": greater than 0 but not exceeding 100.
"Giálượng":
nhập": is require number
"Nhập từ khách
"Ghi chú" hàng":
: Lorem dolor sit amet,"Số
ipsumUnchecked consecteturgreater than
adipiscing 0 but
elit. notporttitor,
Fusce exceedinglibero
100. vel laoreet vestibulum, felis tortor cu
"Nhập từ khách hàng" : Unchecked "Giá
"Số nhập":
lượng": greater
greater than
than 0
0 but
but not
not exceeding
exceeding 10.000.000
100.
"Ghi chú" : aaaaaaaaaaaaaa
"Nhập từ khách hàng" : Unchecked "Giá nhập": greater than 0 but not exceeding 10.000.000
"Giá nhập": greater than 0 but not exceeding 10.000.00
"Ghi chú" : aaaaaaaaaaaaaa
"Nhập từ khách hàng" : Checked "Số lượng": greater than 0 but not exceeding 100
"Giá nhập" is required a number
đảm bảo đủ 3 thông tin ở các code LMN

TAG
VB1, VB4, VP1, VP2, VP3, VB12

VB2, VB4, IB1, IP4, VB10, VB13


VB3, VB4, IP1, IB5,VB10, VB13
VB2, VB5, VP1, IB6, VB10, VB12
VB2, VB5, IP3, VP2, VB11, VB12
VB3, VB5, IP2, IP4, VB10, VP12
VB3, VB5, IB2, IB5, VP3, VP13
VB1, VB4, IP2, IP4, IP7, VB12
VB3, VB4, VB6, IP5, VP3, VB13
VB3, VB4, VB7, IP3, VP3, VB13
Quy ước chấm điểm: Table 3.3 Test case có tổng 1 điểm. Mỗi test case viết ra tương đương 0.1 điểm. Mỗi test case

Module Code Import new product


Tester
ID Test Case Description Pre -Condition
TC001 Import the product success User log into system with correct role

TC002 Import the product fail


TC003 Import the product fail
TC004 Import the product fail
TC005 Import the product fail

TC006 Import the product fail


TC007 Import the product fail
TC008 Import the product fail
TC009 Import the product fail
TC0010 Import the product fail
est case viết ra tương đương 0.1 điểm. Mỗi test case cần đ
Pass: 0 Untested: 0

Fail: 0 N/A: 0
Percent Complete: 0% Number of cases: 2
Test Case Procedure Expected Output
1. Key in "Tên sản phẩm": "Bình công nghiệp 48kg" a new product is successfully imported
2. Key in"Tên nhà cung cấp": "Gas South"
3. Key in"Số lượng": "2"
4. Key in"Giá nhập" "2000"
5. Key in"Ghi chú" : "sale"
6. Key in "Nhập từ khách hàng" : Checked
1. Key in "Tên sản phẩm": "Bình dân dụng 12kg" "Số lượng" : is required number
2. Key in
1. Key in "Tên nhà phẩm":
"Tên sản cung cấp": "Gas
"Bình dânSouth"
dụng 12kg" "Giá nhập" :greater
"Số lượng": greater than
than 0
0 but
but not
not exceeding
exceeding 10.000.000
100.
2.
1. Key in
Key in "Tên nhà cung cấp": "Gas South"
"Tên sản phẩm": "Bình dân dụng 12kg" "Giá nhập": greater than 0 but not exceeding 10.000.000
2.
1. Key
Key in
in "Tên
"Tên nhà phẩm":
sản cung cấp": "Gas
"Bình dânSouth"
dụng 12kg" "Số lượng" is required a number
2. Key in "Tên nhà cung cấp": "Gas petrolimex" "Số lượng": greater than 0 but not exceeding 100.
1. Key in "Tên sản phẩm": "Bình dân dụng 6kg" "Giá nhập": is require number
2.
1. Key
Key in
in "Tên
"Tên nhà cung cấp":
sản phẩm": "Gas
"Bình dânSouth"
dụng 6kg" "Số lượng": greater than 0 but not exceeding 100.
2. "Giá nhập": greater than 0 but not exceeding 10.000.000
1. Key
Key in
in "Tên
"Tên nhà cung cấp":
sản phẩm": Bình"Gas
côngpetrolimex"
nghiệp 48kg "Số lượng": greater than 0 but not exceeding 100.
2. Key in "Tên sản
1. nhà phẩm":
cung cấp": Gas
"Bình South"
dân dụng 6kg" "Giá
"Giá nhập":
nhập": greater
greater than
than 0
0 but
but not
not exceeding
exceeding 10.000.000
10.000.000
2.
1. Key
Key in
in "Tên
"Tên nhà cung cấp":
sản phẩm": Gas
"Bình South
dân dụng 6kg" "Số lượng": greater than 0 but not exceeding 100
"Tên nhà cung cấp": Gas South "Giá nhập" is required a number
Result Bug# Test date Note
(dd/mm/yyyy>
Untest N/A VB1, VB4, VP1, VP2, VP3, VB12
Normal flow

VB2, VB4, IB1, IP4, VB10, VB13


ing 10.000.000 Abnormal flowIB5,VB10, VB13
VB3, VB4, IP1,
ing 10.000.000 Abnormal flow IB6, VB10, VB12
VB2, VB5, VP1,
Abnormal
VB2, flowVP2, VB11, VB12
VB5, IP3,
ceeding 100. Abnormal flow
VB3, VB5, IP2, IP4, VB10, VP12
ding 100. Abnormal
VB3, flowIB5, VP3, VP13
VB5, IB2,
ding 10.000.000 Abnormal flowIP4, IP7, VB12
ing 100. VB1, VB4, IP2,
ing
ing 10.000.000
10.000.000 Abnormal
VB3, VB4, flow
VB6, IP5, VP3, VB13
Abnormal flow
VB3, VB4, VB7, IP3, VP3, VB13
Abnormal flow

You might also like