SlideShare a Scribd company logo
1 of 22
Download to read offline
Pairwise Coverage-based Testing with
Selected Elements in a Query for
Database Applications
Koji Tsumura* Hironori Washizaki* Yoshiaki Fukazawa*,
Keishi Oshima† Ryota Mibe†
*Waseda University, Tokyo, Japan
†Hitachi, Ltd., Japan
IWCT 2016 (ICST 2016 Workshop), Chicago, Apr 10, 2016
2
// Get only voided=false items
public List<Item> getUnvoidedItems( ) {
List<Item> is = getItems( );
List<Item> ret = new ArrayList<Item>();
for (Item i : is) {
// Fault:forget to check voided=false
ret.add(i);
}
return ret;
}
SELECT
id,
name,
voided,
price
FROM items
WHERE
category = ‘food’;
3
// Get only voided=false items
public List<Item> getUnvoidedItems( ) {
List<Item> is = getItems( );
List<Item> ret = new ArrayList<Item>();
for (Item i : is) {
// Fault:forget to check voided=false
ret.add(i);
}
return ret;
}
SELECT
id,
name,
voided,
price
FROM items
WHERE
category = ‘food’;
id name category voided price
1 ‘ABC’ ‘food’ false 200 100% statement coverage!
But failed to reveal fault.
4
// Get only voided=false items
public List<Item> getUnvoidedItems( ) {
List<Item> is = getItems( );
List<Item> ret = new ArrayList<Item>();
for (Item i : is) {
// Fault:forget to check voided=false
ret.add(i);
}
return ret;
}
SELECT
id,
name,
voided,
price
FROM items
WHERE
category = ‘food’;
id name category voided price
1 ‘ABC’ ‘food’ false 200
2 ‘DEF’ ‘clothe’ false 100
100% decision coverage !
But failed to reveal fault.
5
// Get only voided=false items
public List<Item> getUnvoidedItems( ) {
List<Item> is = getItems( );
List<Item> ret = new ArrayList<Item>();
for (Item i : is) {
// Fault:forget to check voided=false
ret.add(i);
}
return ret;
}
SELECT
id,
name,
voided,
price
FROM items
WHERE
category = ‘food’;
id name category voided price
1 ‘ABC’ ‘food’ false 200
2 ‘DEF’ ‘clothe’ false 100
3 ‘GHI’ ‘food’ true 100
4 ‘JKL’ ‘clothe’ true 200
This reveals the fault!
100% pairwise coverage
for columns
{ category, voided, price }.
Testing Database Applications
• Expected behaviors depend on the records
obtained by SQL
– E.g. Some specific items are hidden, …
• We should test them focusing on not only source
code, but also SQL
– Plain Pairwise Coverage (PPC)
– Selected Pairwise Coverage (SPC)
Program
Database
SQL
Record A
Record B
OK Fault
Plain Pairwise Coverage (PPC)
Table Column Equivalence Classes
item
voided true, false
category ‘food’, ‘clothe’
SELECT
id, category, voided,
price
FROM item
WHERE category =
‘food’;
Test ParametersSELECT Query
Coverage Criteria
Pair
category
‘food’ ‘clothe’
voided
true
false
Plain Pairwise Coverage (PPC)
Table Column Equivalence Classes
item
voided true, false
category ‘food’, ‘clothe’
SELECT
id, category, voided,
price
FROM item
WHERE category =
‘food’;
Test ParametersSELECT Query
Coverage Criteria
Pair
category
‘food’ ‘clothe’
voided
true × ×
false ○ ×
id category voided price
5 ‘food’ false 100
9 ‘food’ false 200
Query Results
PPC = 1 / 4 = 25%
Selected Pairwise Coverage (SPC)
Table Column Equivalence Classes
item
voided true, false
category ‘food’, ‘clothe’
SELECT
id, category, voided,
price
FROM item
WHERE category =
‘food’;
Test ParametersSELECT Query
Coverage Criteria
Pair
category
‘food’ ‘clothe’
voided
true
false
Selected Pairwise Coverage (SPC)
Table Column Equivalence Classes
item
voided true, false
category ‘food’, ‘clothe’
SELECT
id, category, voided,
price
FROM item
WHERE category =
‘food’;
Test ParametersSELECT Query
Coverage Criteria
Pair
category
‘food’ ‘clothe’
voided
true
false
Selected Pairwise Coverage (SPC)
Table Column Equivalence Classes
item
voided true, false
category ‘food’, ‘clothe’
SELECT
id, category, voided,
price
FROM item
WHERE category =
‘food’;
Test ParametersSELECT Query
Coverage Criteria
Pair
category
‘food’ ‘clothe’
voided
true ×
false ○
id category voided price
5 ‘food’ false 100
9 ‘food’ false 200
Query Results
SPC = 1 / 2 = 50%
• Targeting only selected columns
• Eliminate impossible combination
by checking WHERE
SPC/PPC Testing Framework (PPC/SPCT)
3.
Generate
test
criteria
4. Execute
queryDatabase
Requireme
nts
1. Set test
parameters
Test
Parameter
s
Test Case
2. Execute
test case
SELECT
Query
Test
Criteria
Query
Results
5.
Calculate
coverage
Coverage
Results
6. Update
database
Automated by our tool
Initial Input
Interim
Result
Final
Result
Process
Case Study
• RQ1:Can SPCT detect faults that existing testing
method cannot?
– Fault detection analysis
• RQ2:How many records are needed to reach 100% SPC
coverage?
– Cost calculation
• Target: two OSSs
– OpenMRS[2], Broadleaf Commerce(BLC)[3]
– 100 tables, 1000 columns
• Comparative existing method
– Full predicate coverage: MC/DC coverage for SQL queries [1]
[1] Tuya et al. “Full predicate coverage for testing SQL database queries”(STVR 2010)
[2] OpenMRS(http://openmrs.org/)
[3] Broadleaf Commerce(http://www.broadleafcommerce.org/)
RQ1. Can SPCT detect faults that existing method cannot?
• Fault Detection Analysis
68
Existing
Method
20
faults
16
47
SPCT
• Fault Detection Analysis
SPCT
6816
47
Existing
Method
20
faults
SPCT can detect 68 faults of 115 faults, which are not detected
by the existing method.
RQ1. Can SPCT detect faults that existing method cannot?
• Fault Detection Analysis
However, 20 faults are detected only by the existing method.
SPCT
6816
47
Existing
Method
20
faults
SPCT can detect 68 faults of 115 faults, which are not detected
by the existing method.
RQ1. Can SPCT detect faults that existing method cannot?
RQ2:How many records to reach 100% SPC coverage?
 Cost Calculation
Target
Number of Records Cost Ratio (%)
Existing PPCT SPCT SPCT/Existing SPCT/PPCT
OpenMRS 529 1506 1300 245.75 86.32
BLC 405 1341 1331 328.64 99.25
Total 934 2847 2631 281.69 92.41
 Cost Calculation
Target
Number of Records Cost Ratio (%)
Existing PPCT SPCT SPCT/Existing SPCT/PPCT
OpenMRS 529 1506 1300 245.75 86.32
BLC 405 1341 1331 328.64 99.25
Total 934 2847 2631 281.69 92.41
SPCT requires 2-3 times more records than the existing
method.
RQ2:How many records to reach 100% SPC coverage?
 Cost Calculation
Target
Number of Records Cost Ratio (%)
Existing PPCT SPCT SPCT/Existing SPCT/PPCT
OpenMRS 529 1506 1300 245.75 86.32
BLC 405 1341 1331 328.64 99.25
Total 934 2847 2631 281.69 92.41
SPCT requires 2-3 times more records than the existing
method.
However, SPCT requires fewer records (0.87 times) than
PPCT.
RQ2:How many records to reach 100% SPC coverage?
 Cost Calculation
Target
Number of Records Cost Ratio (%)
Existing PPCT SPCT SPCT/Existing SPCT/PPCT
OpenMRS 529 1506 1300 245.75 86.32
BLC 405 1341 1331 328.64 99.25
Total 934 2847 2631 281.69 92.41
• Tables are divided into more small units
• BLC joins more tables in a query
• SPCT ignores redundant pairs by focusing only on WHERE clause.
However, SPCT does not focus on the conditions in JOIN clause.
• SPCT can ignore more redundant pairs by focusing on JOIN
clause.
RQ2:How many records to reach 100% SPC coverage?
Conclusion
• Contributions
– We proposed new testing coverage PPC and SPC and
method SPCT for database applications
• by focusing on the elements in SELECT queries
– We implemented a tool to calculate PPC and SPC
– We applied SPCT and PPCT to two open source
software
• PPCT and SPCT can detect 68.54(%) of faults that existing
testing method cannot.
• Future Work
– Ignore more redundant pairs for efficiency
– Automation (e.g. Test Parameter Setting)
22
Mar 13-18 (due Sep 2016)
aster.or.jp/conference/icst2017/
10th IEEE International Conference on
Software Testing, Verification and Validation

More Related Content

Similar to Pairwise Coverage-based Testing with Selected Elements in a Query for Database Applications

Too good to be true? How validate your data
Too good to be true? How validate your dataToo good to be true? How validate your data
Too good to be true? How validate your dataAlex Henderson
 
Rijpma's Catasto meets SPARQL dhb2017_workshop
Rijpma's Catasto meets SPARQL dhb2017_workshopRijpma's Catasto meets SPARQL dhb2017_workshop
Rijpma's Catasto meets SPARQL dhb2017_workshopRichard Zijdeman
 
Bridging the Gap: Machine Learning for Ubiquitous Computing -- Evaluation
Bridging the Gap: Machine Learning for Ubiquitous Computing -- EvaluationBridging the Gap: Machine Learning for Ubiquitous Computing -- Evaluation
Bridging the Gap: Machine Learning for Ubiquitous Computing -- EvaluationThomas Ploetz
 
SFDC Advanced Apex
SFDC Advanced Apex SFDC Advanced Apex
SFDC Advanced Apex Sujit Kumar
 
Automating System Test Case Classification and Prioritization for Use Case-Dr...
Automating System Test Case Classification and Prioritization for Use Case-Dr...Automating System Test Case Classification and Prioritization for Use Case-Dr...
Automating System Test Case Classification and Prioritization for Use Case-Dr...Lionel Briand
 
Top 10 Data Science Practitioner Pitfalls
Top 10 Data Science Practitioner PitfallsTop 10 Data Science Practitioner Pitfalls
Top 10 Data Science Practitioner PitfallsSri Ambati
 
Testing the waters of iOS
Testing the waters of iOSTesting the waters of iOS
Testing the waters of iOSKremizas Kostas
 
Semi-automatic Incompatibility Localization for Re-engineered Industrial Soft...
Semi-automatic Incompatibility Localization for Re-engineered Industrial Soft...Semi-automatic Incompatibility Localization for Re-engineered Industrial Soft...
Semi-automatic Incompatibility Localization for Re-engineered Industrial Soft...Susumu Tokumoto
 
Eastman_MI530_FinalProjectReport
Eastman_MI530_FinalProjectReportEastman_MI530_FinalProjectReport
Eastman_MI530_FinalProjectReportNicholas Eastman
 
Data exploration validation and sanitization
Data exploration validation and sanitizationData exploration validation and sanitization
Data exploration validation and sanitizationVenkata Reddy Konasani
 
Effective Unit Test Style Guide
Effective Unit Test Style GuideEffective Unit Test Style Guide
Effective Unit Test Style GuideJacky Lai
 
John Kent - An Entity Model for Software Testing
John Kent - An Entity Model for Software TestingJohn Kent - An Entity Model for Software Testing
John Kent - An Entity Model for Software TestingTEST Huddle
 
Introduction to Computerized Adaptive Testing (CAT)
Introduction to Computerized Adaptive Testing (CAT)Introduction to Computerized Adaptive Testing (CAT)
Introduction to Computerized Adaptive Testing (CAT)Nathan Thompson
 
BioAssay Express: Creating and exploiting assay metadata
BioAssay Express: Creating and exploiting assay metadataBioAssay Express: Creating and exploiting assay metadata
BioAssay Express: Creating and exploiting assay metadataPhilip Cheung
 
A Preliminary Analysis on the Effect of Randomness in a CEGAR Framework
 A Preliminary Analysis on the Effect of Randomness in a CEGAR Framework A Preliminary Analysis on the Effect of Randomness in a CEGAR Framework
A Preliminary Analysis on the Effect of Randomness in a CEGAR FrameworkAkos Hajdu
 
PL/SQL11g Question #1
PL/SQL11g Question #1PL/SQL11g Question #1
PL/SQL11g Question #1Kai Liu
 

Similar to Pairwise Coverage-based Testing with Selected Elements in a Query for Database Applications (20)

Too good to be true? How validate your data
Too good to be true? How validate your dataToo good to be true? How validate your data
Too good to be true? How validate your data
 
Rijpma's Catasto meets SPARQL dhb2017_workshop
Rijpma's Catasto meets SPARQL dhb2017_workshopRijpma's Catasto meets SPARQL dhb2017_workshop
Rijpma's Catasto meets SPARQL dhb2017_workshop
 
Bridging the Gap: Machine Learning for Ubiquitous Computing -- Evaluation
Bridging the Gap: Machine Learning for Ubiquitous Computing -- EvaluationBridging the Gap: Machine Learning for Ubiquitous Computing -- Evaluation
Bridging the Gap: Machine Learning for Ubiquitous Computing -- Evaluation
 
SFDC Advanced Apex
SFDC Advanced Apex SFDC Advanced Apex
SFDC Advanced Apex
 
Automating System Test Case Classification and Prioritization for Use Case-Dr...
Automating System Test Case Classification and Prioritization for Use Case-Dr...Automating System Test Case Classification and Prioritization for Use Case-Dr...
Automating System Test Case Classification and Prioritization for Use Case-Dr...
 
Top 10 Data Science Practitioner Pitfalls
Top 10 Data Science Practitioner PitfallsTop 10 Data Science Practitioner Pitfalls
Top 10 Data Science Practitioner Pitfalls
 
evaluation and credibility-Part 2
evaluation and credibility-Part 2evaluation and credibility-Part 2
evaluation and credibility-Part 2
 
Testing the waters of iOS
Testing the waters of iOSTesting the waters of iOS
Testing the waters of iOS
 
TDD Training
TDD TrainingTDD Training
TDD Training
 
Semi-automatic Incompatibility Localization for Re-engineered Industrial Soft...
Semi-automatic Incompatibility Localization for Re-engineered Industrial Soft...Semi-automatic Incompatibility Localization for Re-engineered Industrial Soft...
Semi-automatic Incompatibility Localization for Re-engineered Industrial Soft...
 
Nested loop join technique - part2
Nested loop join technique - part2Nested loop join technique - part2
Nested loop join technique - part2
 
Eastman_MI530_FinalProjectReport
Eastman_MI530_FinalProjectReportEastman_MI530_FinalProjectReport
Eastman_MI530_FinalProjectReport
 
Data exploration validation and sanitization
Data exploration validation and sanitizationData exploration validation and sanitization
Data exploration validation and sanitization
 
Effective Unit Test Style Guide
Effective Unit Test Style GuideEffective Unit Test Style Guide
Effective Unit Test Style Guide
 
John Kent - An Entity Model for Software Testing
John Kent - An Entity Model for Software TestingJohn Kent - An Entity Model for Software Testing
John Kent - An Entity Model for Software Testing
 
Introduction to Computerized Adaptive Testing (CAT)
Introduction to Computerized Adaptive Testing (CAT)Introduction to Computerized Adaptive Testing (CAT)
Introduction to Computerized Adaptive Testing (CAT)
 
BioAssay Express: Creating and exploiting assay metadata
BioAssay Express: Creating and exploiting assay metadataBioAssay Express: Creating and exploiting assay metadata
BioAssay Express: Creating and exploiting assay metadata
 
A Preliminary Analysis on the Effect of Randomness in a CEGAR Framework
 A Preliminary Analysis on the Effect of Randomness in a CEGAR Framework A Preliminary Analysis on the Effect of Randomness in a CEGAR Framework
A Preliminary Analysis on the Effect of Randomness in a CEGAR Framework
 
Etl testing
Etl testingEtl testing
Etl testing
 
PL/SQL11g Question #1
PL/SQL11g Question #1PL/SQL11g Question #1
PL/SQL11g Question #1
 

More from Hironori Washizaki

Machine Learning Software Engineering Patterns and Their Engineering
Machine Learning Software Engineering Patterns and Their EngineeringMachine Learning Software Engineering Patterns and Their Engineering
Machine Learning Software Engineering Patterns and Their EngineeringHironori Washizaki
 
IEEE Computer Society 2024 Technology Predictions Update
IEEE Computer Society 2024 Technology Predictions UpdateIEEE Computer Society 2024 Technology Predictions Update
IEEE Computer Society 2024 Technology Predictions UpdateHironori Washizaki
 
鷲崎弘宜, "国際規格ISO/IEC 24773とその意義", 情報処理学会 第86回全国大会
鷲崎弘宜, "国際規格ISO/IEC 24773とその意義", 情報処理学会 第86回全国大会鷲崎弘宜, "国際規格ISO/IEC 24773とその意義", 情報処理学会 第86回全国大会
鷲崎弘宜, "国際規格ISO/IEC 24773とその意義", 情報処理学会 第86回全国大会Hironori Washizaki
 
IEEE Computer Society’s Strategic Activities and Products including SWEBOK Guide
IEEE Computer Society’s Strategic Activities and Products including SWEBOK GuideIEEE Computer Society’s Strategic Activities and Products including SWEBOK Guide
IEEE Computer Society’s Strategic Activities and Products including SWEBOK GuideHironori Washizaki
 
TISO/IEC JTC1におけるソフトウェア工学知識体系、技術者認証および品質の標準化と研究・教育他への活用
TISO/IEC JTC1におけるソフトウェア工学知識体系、技術者認証および品質の標準化と研究・教育他への活用TISO/IEC JTC1におけるソフトウェア工学知識体系、技術者認証および品質の標準化と研究・教育他への活用
TISO/IEC JTC1におけるソフトウェア工学知識体系、技術者認証および品質の標準化と研究・教育他への活用Hironori Washizaki
 
アジャイル品質のパターンとメトリクス Agile Quality Patterns and Metrics (QA2AQ) 20240225
アジャイル品質のパターンとメトリクス Agile Quality Patterns and Metrics (QA2AQ) 20240225アジャイル品質のパターンとメトリクス Agile Quality Patterns and Metrics (QA2AQ) 20240225
アジャイル品質のパターンとメトリクス Agile Quality Patterns and Metrics (QA2AQ) 20240225Hironori Washizaki
 
Joseph Yoder : Being Agile about Architecture
Joseph Yoder : Being Agile about ArchitectureJoseph Yoder : Being Agile about Architecture
Joseph Yoder : Being Agile about ArchitectureHironori Washizaki
 
世界標準のソフトウェア工学知識体系SWEBOK Guide最新第4版を通じた開発アップデート
世界標準のソフトウェア工学知識体系SWEBOK Guide最新第4版を通じた開発アップデート世界標準のソフトウェア工学知識体系SWEBOK Guide最新第4版を通じた開発アップデート
世界標準のソフトウェア工学知識体系SWEBOK Guide最新第4版を通じた開発アップデートHironori Washizaki
 
SWEBOK Guide Evolution and Its Emerging Areas including Machine Learning Patt...
SWEBOK Guide Evolution and Its Emerging Areas including Machine Learning Patt...SWEBOK Guide Evolution and Its Emerging Areas including Machine Learning Patt...
SWEBOK Guide Evolution and Its Emerging Areas including Machine Learning Patt...Hironori Washizaki
 
デジタルトランスフォーメーション(DX)におけるソフトウェアの側面とダイバーシティ・インクルーシブに関する研究実践動向
デジタルトランスフォーメーション(DX)におけるソフトウェアの側面とダイバーシティ・インクルーシブに関する研究実践動向デジタルトランスフォーメーション(DX)におけるソフトウェアの側面とダイバーシティ・インクルーシブに関する研究実践動向
デジタルトランスフォーメーション(DX)におけるソフトウェアの側面とダイバーシティ・インクルーシブに関する研究実践動向Hironori Washizaki
 
SQuBOKガイドV3概説 ~IoT・AI・DX時代のソフトウェア品質とシステム監査~
SQuBOKガイドV3概説 ~IoT・AI・DX時代のソフトウェア品質とシステム監査~SQuBOKガイドV3概説 ~IoT・AI・DX時代のソフトウェア品質とシステム監査~
SQuBOKガイドV3概説 ~IoT・AI・DX時代のソフトウェア品質とシステム監査~Hironori Washizaki
 
人生100年・60年カリキュラム時代のDX人材育成: スマートエスイー 2021年度成果および2022年度募集
人生100年・60年カリキュラム時代のDX人材育成: スマートエスイー 2021年度成果および2022年度募集人生100年・60年カリキュラム時代のDX人材育成: スマートエスイー 2021年度成果および2022年度募集
人生100年・60年カリキュラム時代のDX人材育成: スマートエスイー 2021年度成果および2022年度募集Hironori Washizaki
 
スマートエスイーコンソーシアムの概要と2021年度成果紹介
スマートエスイーコンソーシアムの概要と2021年度成果紹介スマートエスイーコンソーシアムの概要と2021年度成果紹介
スマートエスイーコンソーシアムの概要と2021年度成果紹介Hironori Washizaki
 
DXの推進において企業内に求められる人材やデジタル人材の育て方
DXの推進において企業内に求められる人材やデジタル人材の育て方DXの推進において企業内に求められる人材やデジタル人材の育て方
DXの推進において企業内に求められる人材やデジタル人材の育て方Hironori Washizaki
 
対応性のある運用のパターン
対応性のある運用のパターン対応性のある運用のパターン
対応性のある運用のパターンHironori Washizaki
 
モデル訓練のパターン
モデル訓練のパターンモデル訓練のパターン
モデル訓練のパターンHironori Washizaki
 
パターンのつながりとAI活用成熟度
パターンのつながりとAI活用成熟度パターンのつながりとAI活用成熟度
パターンのつながりとAI活用成熟度Hironori Washizaki
 
データ表現のパターン
データ表現のパターンデータ表現のパターン
データ表現のパターンHironori Washizaki
 
機械学習デザインパターンの必要性と機械学習ライフサイクル
機械学習デザインパターンの必要性と機械学習ライフサイクル機械学習デザインパターンの必要性と機械学習ライフサイクル
機械学習デザインパターンの必要性と機械学習ライフサイクルHironori Washizaki
 
青山幹雄先生を偲んで(開拓、理論、実践、コミュニティ&国際)
青山幹雄先生を偲んで(開拓、理論、実践、コミュニティ&国際)青山幹雄先生を偲んで(開拓、理論、実践、コミュニティ&国際)
青山幹雄先生を偲んで(開拓、理論、実践、コミュニティ&国際)Hironori Washizaki
 

More from Hironori Washizaki (20)

Machine Learning Software Engineering Patterns and Their Engineering
Machine Learning Software Engineering Patterns and Their EngineeringMachine Learning Software Engineering Patterns and Their Engineering
Machine Learning Software Engineering Patterns and Their Engineering
 
IEEE Computer Society 2024 Technology Predictions Update
IEEE Computer Society 2024 Technology Predictions UpdateIEEE Computer Society 2024 Technology Predictions Update
IEEE Computer Society 2024 Technology Predictions Update
 
鷲崎弘宜, "国際規格ISO/IEC 24773とその意義", 情報処理学会 第86回全国大会
鷲崎弘宜, "国際規格ISO/IEC 24773とその意義", 情報処理学会 第86回全国大会鷲崎弘宜, "国際規格ISO/IEC 24773とその意義", 情報処理学会 第86回全国大会
鷲崎弘宜, "国際規格ISO/IEC 24773とその意義", 情報処理学会 第86回全国大会
 
IEEE Computer Society’s Strategic Activities and Products including SWEBOK Guide
IEEE Computer Society’s Strategic Activities and Products including SWEBOK GuideIEEE Computer Society’s Strategic Activities and Products including SWEBOK Guide
IEEE Computer Society’s Strategic Activities and Products including SWEBOK Guide
 
TISO/IEC JTC1におけるソフトウェア工学知識体系、技術者認証および品質の標準化と研究・教育他への活用
TISO/IEC JTC1におけるソフトウェア工学知識体系、技術者認証および品質の標準化と研究・教育他への活用TISO/IEC JTC1におけるソフトウェア工学知識体系、技術者認証および品質の標準化と研究・教育他への活用
TISO/IEC JTC1におけるソフトウェア工学知識体系、技術者認証および品質の標準化と研究・教育他への活用
 
アジャイル品質のパターンとメトリクス Agile Quality Patterns and Metrics (QA2AQ) 20240225
アジャイル品質のパターンとメトリクス Agile Quality Patterns and Metrics (QA2AQ) 20240225アジャイル品質のパターンとメトリクス Agile Quality Patterns and Metrics (QA2AQ) 20240225
アジャイル品質のパターンとメトリクス Agile Quality Patterns and Metrics (QA2AQ) 20240225
 
Joseph Yoder : Being Agile about Architecture
Joseph Yoder : Being Agile about ArchitectureJoseph Yoder : Being Agile about Architecture
Joseph Yoder : Being Agile about Architecture
 
世界標準のソフトウェア工学知識体系SWEBOK Guide最新第4版を通じた開発アップデート
世界標準のソフトウェア工学知識体系SWEBOK Guide最新第4版を通じた開発アップデート世界標準のソフトウェア工学知識体系SWEBOK Guide最新第4版を通じた開発アップデート
世界標準のソフトウェア工学知識体系SWEBOK Guide最新第4版を通じた開発アップデート
 
SWEBOK Guide Evolution and Its Emerging Areas including Machine Learning Patt...
SWEBOK Guide Evolution and Its Emerging Areas including Machine Learning Patt...SWEBOK Guide Evolution and Its Emerging Areas including Machine Learning Patt...
SWEBOK Guide Evolution and Its Emerging Areas including Machine Learning Patt...
 
デジタルトランスフォーメーション(DX)におけるソフトウェアの側面とダイバーシティ・インクルーシブに関する研究実践動向
デジタルトランスフォーメーション(DX)におけるソフトウェアの側面とダイバーシティ・インクルーシブに関する研究実践動向デジタルトランスフォーメーション(DX)におけるソフトウェアの側面とダイバーシティ・インクルーシブに関する研究実践動向
デジタルトランスフォーメーション(DX)におけるソフトウェアの側面とダイバーシティ・インクルーシブに関する研究実践動向
 
SQuBOKガイドV3概説 ~IoT・AI・DX時代のソフトウェア品質とシステム監査~
SQuBOKガイドV3概説 ~IoT・AI・DX時代のソフトウェア品質とシステム監査~SQuBOKガイドV3概説 ~IoT・AI・DX時代のソフトウェア品質とシステム監査~
SQuBOKガイドV3概説 ~IoT・AI・DX時代のソフトウェア品質とシステム監査~
 
人生100年・60年カリキュラム時代のDX人材育成: スマートエスイー 2021年度成果および2022年度募集
人生100年・60年カリキュラム時代のDX人材育成: スマートエスイー 2021年度成果および2022年度募集人生100年・60年カリキュラム時代のDX人材育成: スマートエスイー 2021年度成果および2022年度募集
人生100年・60年カリキュラム時代のDX人材育成: スマートエスイー 2021年度成果および2022年度募集
 
スマートエスイーコンソーシアムの概要と2021年度成果紹介
スマートエスイーコンソーシアムの概要と2021年度成果紹介スマートエスイーコンソーシアムの概要と2021年度成果紹介
スマートエスイーコンソーシアムの概要と2021年度成果紹介
 
DXの推進において企業内に求められる人材やデジタル人材の育て方
DXの推進において企業内に求められる人材やデジタル人材の育て方DXの推進において企業内に求められる人材やデジタル人材の育て方
DXの推進において企業内に求められる人材やデジタル人材の育て方
 
対応性のある運用のパターン
対応性のある運用のパターン対応性のある運用のパターン
対応性のある運用のパターン
 
モデル訓練のパターン
モデル訓練のパターンモデル訓練のパターン
モデル訓練のパターン
 
パターンのつながりとAI活用成熟度
パターンのつながりとAI活用成熟度パターンのつながりとAI活用成熟度
パターンのつながりとAI活用成熟度
 
データ表現のパターン
データ表現のパターンデータ表現のパターン
データ表現のパターン
 
機械学習デザインパターンの必要性と機械学習ライフサイクル
機械学習デザインパターンの必要性と機械学習ライフサイクル機械学習デザインパターンの必要性と機械学習ライフサイクル
機械学習デザインパターンの必要性と機械学習ライフサイクル
 
青山幹雄先生を偲んで(開拓、理論、実践、コミュニティ&国際)
青山幹雄先生を偲んで(開拓、理論、実践、コミュニティ&国際)青山幹雄先生を偲んで(開拓、理論、実践、コミュニティ&国際)
青山幹雄先生を偲んで(開拓、理論、実践、コミュニティ&国際)
 

Recently uploaded

Global Identity Enrolment and Verification Pro Solution - Cizo Technology Ser...
Global Identity Enrolment and Verification Pro Solution - Cizo Technology Ser...Global Identity Enrolment and Verification Pro Solution - Cizo Technology Ser...
Global Identity Enrolment and Verification Pro Solution - Cizo Technology Ser...Cizo Technology Services
 
Ahmed Motair CV April 2024 (Senior SW Developer)
Ahmed Motair CV April 2024 (Senior SW Developer)Ahmed Motair CV April 2024 (Senior SW Developer)
Ahmed Motair CV April 2024 (Senior SW Developer)Ahmed Mater
 
Unveiling Design Patterns: A Visual Guide with UML Diagrams
Unveiling Design Patterns: A Visual Guide with UML DiagramsUnveiling Design Patterns: A Visual Guide with UML Diagrams
Unveiling Design Patterns: A Visual Guide with UML DiagramsAhmed Mohamed
 
cpct NetworkING BASICS AND NETWORK TOOL.ppt
cpct NetworkING BASICS AND NETWORK TOOL.pptcpct NetworkING BASICS AND NETWORK TOOL.ppt
cpct NetworkING BASICS AND NETWORK TOOL.pptrcbcrtm
 
Unveiling the Future: Sylius 2.0 New Features
Unveiling the Future: Sylius 2.0 New FeaturesUnveiling the Future: Sylius 2.0 New Features
Unveiling the Future: Sylius 2.0 New FeaturesŁukasz Chruściel
 
Introduction Computer Science - Software Design.pdf
Introduction Computer Science - Software Design.pdfIntroduction Computer Science - Software Design.pdf
Introduction Computer Science - Software Design.pdfFerryKemperman
 
Implementing Zero Trust strategy with Azure
Implementing Zero Trust strategy with AzureImplementing Zero Trust strategy with Azure
Implementing Zero Trust strategy with AzureDinusha Kumarasiri
 
Comparing Linux OS Image Update Models - EOSS 2024.pdf
Comparing Linux OS Image Update Models - EOSS 2024.pdfComparing Linux OS Image Update Models - EOSS 2024.pdf
Comparing Linux OS Image Update Models - EOSS 2024.pdfDrew Moseley
 
What is Fashion PLM and Why Do You Need It
What is Fashion PLM and Why Do You Need ItWhat is Fashion PLM and Why Do You Need It
What is Fashion PLM and Why Do You Need ItWave PLM
 
Cyber security and its impact on E commerce
Cyber security and its impact on E commerceCyber security and its impact on E commerce
Cyber security and its impact on E commercemanigoyal112
 
Open Source Summit NA 2024: Open Source Cloud Costs - OpenCost's Impact on En...
Open Source Summit NA 2024: Open Source Cloud Costs - OpenCost's Impact on En...Open Source Summit NA 2024: Open Source Cloud Costs - OpenCost's Impact on En...
Open Source Summit NA 2024: Open Source Cloud Costs - OpenCost's Impact on En...Matt Ray
 
Precise and Complete Requirements? An Elusive Goal
Precise and Complete Requirements? An Elusive GoalPrecise and Complete Requirements? An Elusive Goal
Precise and Complete Requirements? An Elusive GoalLionel Briand
 
GOING AOT WITH GRAALVM – DEVOXX GREECE.pdf
GOING AOT WITH GRAALVM – DEVOXX GREECE.pdfGOING AOT WITH GRAALVM – DEVOXX GREECE.pdf
GOING AOT WITH GRAALVM – DEVOXX GREECE.pdfAlina Yurenko
 
Tech Tuesday - Mastering Time Management Unlock the Power of OnePlan's Timesh...
Tech Tuesday - Mastering Time Management Unlock the Power of OnePlan's Timesh...Tech Tuesday - Mastering Time Management Unlock the Power of OnePlan's Timesh...
Tech Tuesday - Mastering Time Management Unlock the Power of OnePlan's Timesh...OnePlan Solutions
 
KnowAPIs-UnknownPerf-jaxMainz-2024 (1).pptx
KnowAPIs-UnknownPerf-jaxMainz-2024 (1).pptxKnowAPIs-UnknownPerf-jaxMainz-2024 (1).pptx
KnowAPIs-UnknownPerf-jaxMainz-2024 (1).pptxTier1 app
 
Alfresco TTL#157 - Troubleshooting Made Easy: Deciphering Alfresco mTLS Confi...
Alfresco TTL#157 - Troubleshooting Made Easy: Deciphering Alfresco mTLS Confi...Alfresco TTL#157 - Troubleshooting Made Easy: Deciphering Alfresco mTLS Confi...
Alfresco TTL#157 - Troubleshooting Made Easy: Deciphering Alfresco mTLS Confi...Angel Borroy López
 
Software Project Health Check: Best Practices and Techniques for Your Product...
Software Project Health Check: Best Practices and Techniques for Your Product...Software Project Health Check: Best Practices and Techniques for Your Product...
Software Project Health Check: Best Practices and Techniques for Your Product...Velvetech LLC
 
Powering Real-Time Decisions with Continuous Data Streams
Powering Real-Time Decisions with Continuous Data StreamsPowering Real-Time Decisions with Continuous Data Streams
Powering Real-Time Decisions with Continuous Data StreamsSafe Software
 
Software Coding for software engineering
Software Coding for software engineeringSoftware Coding for software engineering
Software Coding for software engineeringssuserb3a23b
 

Recently uploaded (20)

Global Identity Enrolment and Verification Pro Solution - Cizo Technology Ser...
Global Identity Enrolment and Verification Pro Solution - Cizo Technology Ser...Global Identity Enrolment and Verification Pro Solution - Cizo Technology Ser...
Global Identity Enrolment and Verification Pro Solution - Cizo Technology Ser...
 
Ahmed Motair CV April 2024 (Senior SW Developer)
Ahmed Motair CV April 2024 (Senior SW Developer)Ahmed Motair CV April 2024 (Senior SW Developer)
Ahmed Motair CV April 2024 (Senior SW Developer)
 
Unveiling Design Patterns: A Visual Guide with UML Diagrams
Unveiling Design Patterns: A Visual Guide with UML DiagramsUnveiling Design Patterns: A Visual Guide with UML Diagrams
Unveiling Design Patterns: A Visual Guide with UML Diagrams
 
cpct NetworkING BASICS AND NETWORK TOOL.ppt
cpct NetworkING BASICS AND NETWORK TOOL.pptcpct NetworkING BASICS AND NETWORK TOOL.ppt
cpct NetworkING BASICS AND NETWORK TOOL.ppt
 
Unveiling the Future: Sylius 2.0 New Features
Unveiling the Future: Sylius 2.0 New FeaturesUnveiling the Future: Sylius 2.0 New Features
Unveiling the Future: Sylius 2.0 New Features
 
Introduction Computer Science - Software Design.pdf
Introduction Computer Science - Software Design.pdfIntroduction Computer Science - Software Design.pdf
Introduction Computer Science - Software Design.pdf
 
Implementing Zero Trust strategy with Azure
Implementing Zero Trust strategy with AzureImplementing Zero Trust strategy with Azure
Implementing Zero Trust strategy with Azure
 
Comparing Linux OS Image Update Models - EOSS 2024.pdf
Comparing Linux OS Image Update Models - EOSS 2024.pdfComparing Linux OS Image Update Models - EOSS 2024.pdf
Comparing Linux OS Image Update Models - EOSS 2024.pdf
 
What is Fashion PLM and Why Do You Need It
What is Fashion PLM and Why Do You Need ItWhat is Fashion PLM and Why Do You Need It
What is Fashion PLM and Why Do You Need It
 
Cyber security and its impact on E commerce
Cyber security and its impact on E commerceCyber security and its impact on E commerce
Cyber security and its impact on E commerce
 
Open Source Summit NA 2024: Open Source Cloud Costs - OpenCost's Impact on En...
Open Source Summit NA 2024: Open Source Cloud Costs - OpenCost's Impact on En...Open Source Summit NA 2024: Open Source Cloud Costs - OpenCost's Impact on En...
Open Source Summit NA 2024: Open Source Cloud Costs - OpenCost's Impact on En...
 
Precise and Complete Requirements? An Elusive Goal
Precise and Complete Requirements? An Elusive GoalPrecise and Complete Requirements? An Elusive Goal
Precise and Complete Requirements? An Elusive Goal
 
GOING AOT WITH GRAALVM – DEVOXX GREECE.pdf
GOING AOT WITH GRAALVM – DEVOXX GREECE.pdfGOING AOT WITH GRAALVM – DEVOXX GREECE.pdf
GOING AOT WITH GRAALVM – DEVOXX GREECE.pdf
 
Tech Tuesday - Mastering Time Management Unlock the Power of OnePlan's Timesh...
Tech Tuesday - Mastering Time Management Unlock the Power of OnePlan's Timesh...Tech Tuesday - Mastering Time Management Unlock the Power of OnePlan's Timesh...
Tech Tuesday - Mastering Time Management Unlock the Power of OnePlan's Timesh...
 
KnowAPIs-UnknownPerf-jaxMainz-2024 (1).pptx
KnowAPIs-UnknownPerf-jaxMainz-2024 (1).pptxKnowAPIs-UnknownPerf-jaxMainz-2024 (1).pptx
KnowAPIs-UnknownPerf-jaxMainz-2024 (1).pptx
 
Alfresco TTL#157 - Troubleshooting Made Easy: Deciphering Alfresco mTLS Confi...
Alfresco TTL#157 - Troubleshooting Made Easy: Deciphering Alfresco mTLS Confi...Alfresco TTL#157 - Troubleshooting Made Easy: Deciphering Alfresco mTLS Confi...
Alfresco TTL#157 - Troubleshooting Made Easy: Deciphering Alfresco mTLS Confi...
 
Hot Sexy call girls in Patel Nagar🔝 9953056974 🔝 escort Service
Hot Sexy call girls in Patel Nagar🔝 9953056974 🔝 escort ServiceHot Sexy call girls in Patel Nagar🔝 9953056974 🔝 escort Service
Hot Sexy call girls in Patel Nagar🔝 9953056974 🔝 escort Service
 
Software Project Health Check: Best Practices and Techniques for Your Product...
Software Project Health Check: Best Practices and Techniques for Your Product...Software Project Health Check: Best Practices and Techniques for Your Product...
Software Project Health Check: Best Practices and Techniques for Your Product...
 
Powering Real-Time Decisions with Continuous Data Streams
Powering Real-Time Decisions with Continuous Data StreamsPowering Real-Time Decisions with Continuous Data Streams
Powering Real-Time Decisions with Continuous Data Streams
 
Software Coding for software engineering
Software Coding for software engineeringSoftware Coding for software engineering
Software Coding for software engineering
 

Pairwise Coverage-based Testing with Selected Elements in a Query for Database Applications

  • 1. Pairwise Coverage-based Testing with Selected Elements in a Query for Database Applications Koji Tsumura* Hironori Washizaki* Yoshiaki Fukazawa*, Keishi Oshima† Ryota Mibe† *Waseda University, Tokyo, Japan †Hitachi, Ltd., Japan IWCT 2016 (ICST 2016 Workshop), Chicago, Apr 10, 2016
  • 2. 2 // Get only voided=false items public List<Item> getUnvoidedItems( ) { List<Item> is = getItems( ); List<Item> ret = new ArrayList<Item>(); for (Item i : is) { // Fault:forget to check voided=false ret.add(i); } return ret; } SELECT id, name, voided, price FROM items WHERE category = ‘food’;
  • 3. 3 // Get only voided=false items public List<Item> getUnvoidedItems( ) { List<Item> is = getItems( ); List<Item> ret = new ArrayList<Item>(); for (Item i : is) { // Fault:forget to check voided=false ret.add(i); } return ret; } SELECT id, name, voided, price FROM items WHERE category = ‘food’; id name category voided price 1 ‘ABC’ ‘food’ false 200 100% statement coverage! But failed to reveal fault.
  • 4. 4 // Get only voided=false items public List<Item> getUnvoidedItems( ) { List<Item> is = getItems( ); List<Item> ret = new ArrayList<Item>(); for (Item i : is) { // Fault:forget to check voided=false ret.add(i); } return ret; } SELECT id, name, voided, price FROM items WHERE category = ‘food’; id name category voided price 1 ‘ABC’ ‘food’ false 200 2 ‘DEF’ ‘clothe’ false 100 100% decision coverage ! But failed to reveal fault.
  • 5. 5 // Get only voided=false items public List<Item> getUnvoidedItems( ) { List<Item> is = getItems( ); List<Item> ret = new ArrayList<Item>(); for (Item i : is) { // Fault:forget to check voided=false ret.add(i); } return ret; } SELECT id, name, voided, price FROM items WHERE category = ‘food’; id name category voided price 1 ‘ABC’ ‘food’ false 200 2 ‘DEF’ ‘clothe’ false 100 3 ‘GHI’ ‘food’ true 100 4 ‘JKL’ ‘clothe’ true 200 This reveals the fault! 100% pairwise coverage for columns { category, voided, price }.
  • 6. Testing Database Applications • Expected behaviors depend on the records obtained by SQL – E.g. Some specific items are hidden, … • We should test them focusing on not only source code, but also SQL – Plain Pairwise Coverage (PPC) – Selected Pairwise Coverage (SPC) Program Database SQL Record A Record B OK Fault
  • 7. Plain Pairwise Coverage (PPC) Table Column Equivalence Classes item voided true, false category ‘food’, ‘clothe’ SELECT id, category, voided, price FROM item WHERE category = ‘food’; Test ParametersSELECT Query Coverage Criteria Pair category ‘food’ ‘clothe’ voided true false
  • 8. Plain Pairwise Coverage (PPC) Table Column Equivalence Classes item voided true, false category ‘food’, ‘clothe’ SELECT id, category, voided, price FROM item WHERE category = ‘food’; Test ParametersSELECT Query Coverage Criteria Pair category ‘food’ ‘clothe’ voided true × × false ○ × id category voided price 5 ‘food’ false 100 9 ‘food’ false 200 Query Results PPC = 1 / 4 = 25%
  • 9. Selected Pairwise Coverage (SPC) Table Column Equivalence Classes item voided true, false category ‘food’, ‘clothe’ SELECT id, category, voided, price FROM item WHERE category = ‘food’; Test ParametersSELECT Query Coverage Criteria Pair category ‘food’ ‘clothe’ voided true false
  • 10. Selected Pairwise Coverage (SPC) Table Column Equivalence Classes item voided true, false category ‘food’, ‘clothe’ SELECT id, category, voided, price FROM item WHERE category = ‘food’; Test ParametersSELECT Query Coverage Criteria Pair category ‘food’ ‘clothe’ voided true false
  • 11. Selected Pairwise Coverage (SPC) Table Column Equivalence Classes item voided true, false category ‘food’, ‘clothe’ SELECT id, category, voided, price FROM item WHERE category = ‘food’; Test ParametersSELECT Query Coverage Criteria Pair category ‘food’ ‘clothe’ voided true × false ○ id category voided price 5 ‘food’ false 100 9 ‘food’ false 200 Query Results SPC = 1 / 2 = 50% • Targeting only selected columns • Eliminate impossible combination by checking WHERE
  • 12. SPC/PPC Testing Framework (PPC/SPCT) 3. Generate test criteria 4. Execute queryDatabase Requireme nts 1. Set test parameters Test Parameter s Test Case 2. Execute test case SELECT Query Test Criteria Query Results 5. Calculate coverage Coverage Results 6. Update database Automated by our tool Initial Input Interim Result Final Result Process
  • 13. Case Study • RQ1:Can SPCT detect faults that existing testing method cannot? – Fault detection analysis • RQ2:How many records are needed to reach 100% SPC coverage? – Cost calculation • Target: two OSSs – OpenMRS[2], Broadleaf Commerce(BLC)[3] – 100 tables, 1000 columns • Comparative existing method – Full predicate coverage: MC/DC coverage for SQL queries [1] [1] Tuya et al. “Full predicate coverage for testing SQL database queries”(STVR 2010) [2] OpenMRS(http://openmrs.org/) [3] Broadleaf Commerce(http://www.broadleafcommerce.org/)
  • 14. RQ1. Can SPCT detect faults that existing method cannot? • Fault Detection Analysis 68 Existing Method 20 faults 16 47 SPCT
  • 15. • Fault Detection Analysis SPCT 6816 47 Existing Method 20 faults SPCT can detect 68 faults of 115 faults, which are not detected by the existing method. RQ1. Can SPCT detect faults that existing method cannot?
  • 16. • Fault Detection Analysis However, 20 faults are detected only by the existing method. SPCT 6816 47 Existing Method 20 faults SPCT can detect 68 faults of 115 faults, which are not detected by the existing method. RQ1. Can SPCT detect faults that existing method cannot?
  • 17. RQ2:How many records to reach 100% SPC coverage?  Cost Calculation Target Number of Records Cost Ratio (%) Existing PPCT SPCT SPCT/Existing SPCT/PPCT OpenMRS 529 1506 1300 245.75 86.32 BLC 405 1341 1331 328.64 99.25 Total 934 2847 2631 281.69 92.41
  • 18.  Cost Calculation Target Number of Records Cost Ratio (%) Existing PPCT SPCT SPCT/Existing SPCT/PPCT OpenMRS 529 1506 1300 245.75 86.32 BLC 405 1341 1331 328.64 99.25 Total 934 2847 2631 281.69 92.41 SPCT requires 2-3 times more records than the existing method. RQ2:How many records to reach 100% SPC coverage?
  • 19.  Cost Calculation Target Number of Records Cost Ratio (%) Existing PPCT SPCT SPCT/Existing SPCT/PPCT OpenMRS 529 1506 1300 245.75 86.32 BLC 405 1341 1331 328.64 99.25 Total 934 2847 2631 281.69 92.41 SPCT requires 2-3 times more records than the existing method. However, SPCT requires fewer records (0.87 times) than PPCT. RQ2:How many records to reach 100% SPC coverage?
  • 20.  Cost Calculation Target Number of Records Cost Ratio (%) Existing PPCT SPCT SPCT/Existing SPCT/PPCT OpenMRS 529 1506 1300 245.75 86.32 BLC 405 1341 1331 328.64 99.25 Total 934 2847 2631 281.69 92.41 • Tables are divided into more small units • BLC joins more tables in a query • SPCT ignores redundant pairs by focusing only on WHERE clause. However, SPCT does not focus on the conditions in JOIN clause. • SPCT can ignore more redundant pairs by focusing on JOIN clause. RQ2:How many records to reach 100% SPC coverage?
  • 21. Conclusion • Contributions – We proposed new testing coverage PPC and SPC and method SPCT for database applications • by focusing on the elements in SELECT queries – We implemented a tool to calculate PPC and SPC – We applied SPCT and PPCT to two open source software • PPCT and SPCT can detect 68.54(%) of faults that existing testing method cannot. • Future Work – Ignore more redundant pairs for efficiency – Automation (e.g. Test Parameter Setting)
  • 22. 22 Mar 13-18 (due Sep 2016) aster.or.jp/conference/icst2017/ 10th IEEE International Conference on Software Testing, Verification and Validation