2014/07/07 Software Testing - Truong Anh Hoang Vu Hung Nguyen
油
Topics:
1. Sharing experience on software testings
2. Automation testing for web application
3. Testing techniques: Tips and tricks (for webapp)
4. How to plan testing, how to write effective test cases so that we can find more bugs
5. What is BDD and how to apply it software testing
6. The importance of developer testing (testing by developers)
Contents
K畛 thu畉t ki畛m th畛 - tips & tricks
- H畛p en - tester
- H畛p tr畉ng - developer testing
- Ki畛m th畛 董n v畛 - automation, developer testing
Ki畛m th畛 web - webapp
- Demo
- Kinh nghi畛m t畛 畛ng v畛i selenium - tips, automation,
Ph叩t tri畛n theo hnh vi - BDD
- Gi畛i thi畛u BDD (behaviour driven development)
- Demo behat
Unit Test with test JUNIT , JUnit is a simple framework to write repeatable tests. It is an instance of the xUnit architecture for unit testing frameworks.
Unit Test with test JUNIT , JUnit is a simple framework to write repeatable tests. It is an instance of the xUnit architecture for unit testing frameworks.
AVL Trees
Adelson-Velskii and Landis
Binary Search Tree - Best Time
All BST operations are O(d), where d is tree depth
minimum d is for a binary tree with N nodes
What is the best case tree?
What is the worst case tree?
So, best case running time of BST operations is O(log N)
Binary Search Tree - Worst Time
Worst case running time is O(N)
What happens when you Insert elements in ascending order?
Insert: 2, 4, 6, 8, 10, 12 into an empty BST
Problem: Lack of balance:
compare depths of left and right subtree
Unbalanced degenerate tree
Balanced and unbalanced BST
Approaches to balancing trees
Don't balance
May end up with some nodes very deep
Strict balance
The tree must always be balanced perfectly
Pretty good balance
Only allow a little out of balance
Adjust on access
Self-adjusting
Balancing Binary Search Trees
Many algorithms exist for keeping binary search trees balanced
Adelson-Velskii and Landis (AVL) trees (height-balanced trees)
Splay trees and other self-adjusting trees
B-trees and other multiway search trees
Perfect Balance
Want a complete tree after every operation
tree is full except possibly in the lower right
This is expensive
For example, insert 2 in the tree on the left and then rebuild as a complete tree
AVL - Good but not Perfect Balance
AVL trees are height-balanced binary search trees
Balance factor of a node
height(left subtree) - height(right subtree)
An AVL tree has balance factor calculated at every node
For every node, heights of left and right subtree can differ by no more than 1
Store current heights in each node
Height of an AVL Tree
N(h) = minimum number of nodes in an AVL tree of height h.
Basis
N(0) = 1, N(1) = 2
Induction
N(h) = N(h-1) + N(h-2) + 1
Solution (recall Fibonacci analysis)
N(h) > h ( 1.62)
Height of an AVL Tree
N(h) > h ( 1.62)
Suppose we have n nodes in an AVL tree of height h.
n > N(h) (because N(h) was the minimum)
n > h hence log n > h (relatively well balanced tree!!)
h < 1.44 log2n (i.e., Find takes O(logn))
Node Heights
Node Heights after Insert 7
Insert and Rotation in AVL Trees
Insert operation may cause balance factor to become 2 or 2 for some node
only nodes on the path from insertion point to root node have possibly changed in height
So after the Insert, go back up to the root node by node, updating heights
If a new balance factor is 2 or 2, adjust tree by rotation around the node
Single Rotation in an AVL Tree
Implementation
Single Rotation
Double Rotation
Implement Double Rotation in two lines.
Insertion in AVL Trees
Insert at the leaf (as for all BST)
only nodes on the path from insertion point to root node have possibly changed in height
So after the Insert, go back up to the root node by node, updating heights
If a new balance factor is 2 or 2, adjust tree by rotation around the node
Insert in BST
Insert in AVL trees
Example of Insertions in an A
This document provides an overview of cloud computing. It defines cloud computing as network-based computing that takes place over the Internet, providing hardware, software, and networking services to clients. Key characteristics of cloud computing include on-demand services that are available anywhere and anytime, elastic scaling, and pay-as-you-go pricing. The document discusses different cloud service models including Software as a Service (SaaS), Platform as a Service (PaaS), and Infrastructure as a Service (IaaS). It also covers advantages such as lower costs, improved performance and collaboration, and unlimited storage, as well as disadvantages like reliance on internet connectivity and potential security and data loss issues.
This document provides an introduction and overview of cloud computing and related topics. It discusses web-scale problems involving large amounts of data, the use of large data centers to process this data in parallel, and different models for cloud computing including utility computing, platform as a service, and software as a service. It also covers challenges in parallel and distributed processing like assigning work units across workers and managing shared resources and synchronization.
Thus cloud computing provides super-computing power by connecting hundreds or thousands of computers together in a cloud. This cloud of computers extends beyond a single company or enterprise, making the applications and data accessible to a broad group of users across different companies and platforms. Users can access documents, software programs, and other data from any Internet-connected computer rather than just their own personal computer.
4. Ki畛m tra ch畛c nng
L d畉ng ki畛m tra Black-Box v狸 kh担ng quan
t但m b棚n trong ch動董ng tr狸nh
V畛i c叩c th担ng tin 畉u vo ki畛m tra k畉t qu畉
畉u ra, kh担ng quan t但m t畛i c叩ch th畛c th畛c
thi b棚n trong
NNTu Software Testing S2008 4
5. Ki畛m tra ch畛c nng
T畉p trung vo ch畛c nng c畛a h畛
th畛ng
Ph叩t tri畛n t畛 y棚u c畉u
Ki畛m tra hnh vi
C畉n
Bi畉t c叩c k畉t qu畉 k畛 v畛ng
Ki畛m tra c畉 gi叩 tr畛 valid v invalid
Unit test cases c坦 th畛 動畛c d湛ng
l畉i
H動畛ng t畛i TC cho ng動畛i m畛i s畛
d畛ng
NNTu Software Testing S2008 5
14. Ki畛m tra h畛 th畛ng
M畛c ch畉t l動畛ng
Usability Scalability Reliability
Performance Availability
Load Stress Spike/Bounce Endurance
Test Test Test Test
Smoke Peak Load Low Resource Volume
Test Test Test Test
NNTu Software Testing S2008 14
15. Ki畛m tra h畛 th畛ng
Ki畛m tra ti畛n 鱈ch (facility)
Ki畛m tra kh畛i l動畛ng (volume)
Ki畛m tra qu叩 t畉i (stress)
Ki畛m tra t鱈nh kh畉 d畛ng (usability)
Ki畛m tra b畉o m畉t
Ki畛m tra hi畛u nng/th畛c thi
Ki畛m tra vi畛c l動u tr畛
Ki畛m tra c畉u h狸nh
Ki畛m tra t鱈nh t動董ng th鱈ch
Ki畛m tra kh畉 nng ci 畉t
Ki畛m tra t鱈nh tin c畉y
Ki畛m tra t鱈nh ph畛c h畛i
Ki畛m tra d畛ch v畛
Ki畛m tra ti li畛u
Ki畛m tra th畛 t畛c
NNTu Software Testing S2008 15
16. Ki畛m tra m畛c ti畛n l畛i (facility)
Ki畛m tra c叩c ti畛n 鱈ch h畛 tr畛 k竪m theo c叩c
ch畛c nng ch鱈nh
NNTu Software Testing S2008 16
25. Ki畛m tra th畛c thi / hi畛u nng
Performance Testing
動畛c xem nh動 bao g畛m c叩c ki畛m th畛 sau
Load Test
Stress Test
Volume Test
Test data
Response time
NNTu Software Testing S2008 25
26. Ki畛m tra th畛c thi/hi畛u nng
Required Test Tools
Expected Level of
Load Test Environment
Performance
Performance Specialists
Measured
Test Cases Performance
Computer System
Industry
Standard Application
Benchmarks Security Layer
Inputs Outputs
NNTu Software Testing S2008 26
27. Ki畛m tra vi畛c l動u tr畛
Ki畛m tra hi畛u qu畉 th畛c thi vi畛c l動u tr畛 th担ng
tin
NNTu Software Testing S2008 27
28. Ki畛m tra t鱈nh t動董ng th鱈ch
Ki畛m tra vi畛c th畛c thi c畛a ph畉n m畛m trong
m担i tr動畛ng th畛c t畉
NNTu Software Testing S2008 28
29. Ki畛m tra t鱈nh ph畛c h畛i
Ki畛m tra kh畉 nng th畛c thi l畉i (ph畛c h畛i) sau
khi c坦 c叩c s畛 c畛
Treo
H畛ng ph畉n c畛ng
V畉n 畛 h畛ng h坦c
NNTu Software Testing S2008 29
30. Ki畛m tra X叩c th畛c/ch畉p nh畉n
Acceptance Testing
M畛c ti棚u
X叩c nh畉n t畛 ph鱈a ng動畛i s畛 d畛ng
i畛u ki畛n
Ki畛m tra h畛i h畛 th畛ng v h畛i quy hon t畉t
Ng動畛i Qu畉n l箪 c畉u h狸nh
Test data
Ti li畛u h動畛ng d畉n cu畛i c湛ng 達 s畉n sng
達 x辿t c叩c th畛 t畛c ki畛m th畛
i畛u ki畛n tho叩t
C叩c th畛 t畛c 畉c bi畛t
Ti棚u chu畉n ch畉p nh畉n ph畉i 動畛c l畉p ti li畛u
Acceptance Testing
Ng動畛i ch畛u tr叩ch nhi畛m
NNTu Software Testing S2008 30
31. Ki畛m tra X叩c th畛c/ch畉p nh畉n
Acceptance Testing
K畛 v畛ng
X叩c nh畉n t畛 ph鱈a ng動畛i s畛 d畛ng
Ki畛m tra th畛c thi 動畛c 叩nh gi叩 l畉i
K辿o di th畛i gian
H動畛ng d畉n cho ng動畛i ki畛m th畛
C叩c y棚u c畉u kh担ng c坦 kh畉 nng ki畛m th畛
R so叩t b畛i ng動畛i ti tr畛 v NSD
K畉 ho畉ch cho vi畛c hi畛n th畛c
NNTu Software Testing S2008 31
32. Ki畛m tra ci 畉t
Ki畛m tra kh畉 nng ci, g畛 b畛 m畛t ph畉n v
ton b畛 ch動董ng tr狸nh
NNTu Software Testing S2008 32