Download presentation
Presentation is loading. Please wait.
1
Practical SQL for SlickPic Testing
2
SlickPic Database environments
Database: ORACLE Express Database: MySQL can be loaded from GUI Studio:
3
SlickPic database in Oracle
Create a fragment of database objects (tables) in Oracle in proper order Populate the created tables with test data in proper order Grey Box testing using SQL statements
4
Create database tables sp_user
create table sp_user (user_id number primary key, login_type varchar(20) not null, login varchar(20), pw varchar(20), first_name varchar(60), last_name varchar(60), account_type varchar(20), Account_state varchar(12), Created date, Last_login date );
5
Create database tables sp_album table
create table sp_album (album_ID number primary key, user_id number not null, name varchar(120) not null, description varchar(1200), date_created date, date_modified date, album_type varchar(20) not null, number_of_photos number, parent_album_id number not null, CONSTRAINT user_FK FOREIGN KEY (user_ID) REFERENCES sp_user (user_id));
6
Create database tables sp_photo table
create table sp_photo (album_id number not null, photo_id number not null, file_name varchar(60), file_format varchar(12) not null, photo_name varchar(120), description varchar(1200), photo_size_mg number not null, resticted_flag char(1), likes number, number_of_comments number, file_location varchar(200) not null, Constraint photo_pk primary key (album_id, photo_id), CONSTRAINT album_FK FOREIGN KEY (album_ID) REFERENCES sp_album (album_id));
7
sp_user sp_album sp_photo Creating test data
Tables must be populated with test data in in proper parent child relation order: sp_user insert into sp_user values (100, ‘OPENID’ ,null, null,‘Suba’, null,'PRO','ACTIVE', sysdate-5, sysdate); sp_album insert into sp_album values (200, 110, 'Party', 'Grad Party with mom', sysdate-32, null, 'Public', 200) ; sp_photo insert into sp_photo values (200, 300,null,'jpeg','Ready to go',null,13,null,23,4,'grad/album 1');
8
Using SQL for Test Cases
TC ID Test Intent Test Data 1. Verify that application displays number of albums per user correctly. Select user_id, count(album_id) album_count from sp_album group by user_id order by album_count desc 1.2 Verify that application displays number of photos per user correctly. Select user_id, count(photo_id) from sp_album a, sp_photo p where a.album_id=p.album_id group by user_id 1.3 Verify that when user changes the number of photos - deletes, adds them back, this number is being updated and displayed properly Select user_id, count(photo_id) from sp_album a, sp_photo p where a.album_id=p.album_id group by user_id Home Work: Complete Test Cases by adding Steps, Expected Result, and Execution Environment (Oracle, MySQL), and Execution Result (Pass, Fail)
9
Using SQL for Test Cases
TC ID Test Intent Testing Strategy Test Data 2. Validate proper GUI presentation of large number of Albums and Photos Identify User account(s) having large number of Albums and Photos Select user_id, count(album_id) album_count from sp_album group by user_id order by album_count desc Select user_id, count(photo_id) photo_count from sp_album a, sp_photo p where a.album_id=p.album_id group by user_id order by photo_count desc 3 Validate the boundary values of Photo file size for each type of user account, such as ‘PRO’/25 MB, ‘BASIC’/15 MB, and etc. Select the MAX Photo file size by account type Select account_type, max(photo_size_mg) from sp_user u, sp_album a, sp_photo p where u.user_id=a.user_id and a.album_id=p.album_id group by account_type; Home Work: Complete Test Cases by adding Steps, Expected Result, and Execution Environment (Oracle, MySQL), and Execution Result (Pass, Fail)
10
Quiz Foreign Key relation
SP_ALBUM SP_USER Album_ID User_ID Foreign Key …… 211 123 214 198 256 User_ID Primary Key …….. 123 167 198 SP_USER has 100 records; SP_ALBUM has 1000 records SP_USER has 1000 records; SP_ALBUM has 100 records Select User_ID, Album_ID from sp_user, sp_album where sp_user.user_id=sp_album.user_id Number of records retrieved: a) 100 b) c) 1100 a) 100 b) c) 1100 Quiz Results: 1. 2.
Similar presentations
© 2025 SlidePlayer.com. Inc.
All rights reserved.