软件测试--求oracle代码白盒测试用例设计
如何对代码编写测试用例?例如代码:
CREATE OR REPLACE PACKAGE BODY delete_student_pkg AS
type student_id_ttype IS TABLE OF wl_student_tab.STUDENT_ID%TYPE INDEX BY pls_integer;
type course_id_ttype IS TABLE OF wl_course_tab.course_id%TYPE INDEX BY pls_integer;
type sel_course_ttype IS TABLE Of(wl_selected_course_tab.STUDENT_ID,wl_selected_course_tab.COURSE_ID)%TYPE INDEX BY pls_integer;
lt_student_id student_id_ttype;
lt_course_id course_id_ttype;
lt_sel_course sel_course_ttype;
ln_student_id NUMBER;
lv_message VARCHAR2(2000);
app_err_expt EXCEPTION;
PROCEDURE main(p_student_name IN VARCHAR2) AS
BEGIN
SELECT student_id
INTO ln_student_id
FROM wl_student_tab
WHERE student_name = p_student_name;
EXCEPTION
WHEN no_data_found THEN
DBMS_OUTPUT.PUT_LINE(p_student_name || 'student data doesnt exist in wl_student_tab table.');
-- RAISE app_err_expt;
END;
BEGIN
DELETE FROM wl_score_tab wst
WHERE wst.student_id = ln_student_id returning
student_id,course_id bulk collect
INTO lt_student_id,lt_course_id;
DBMS_OUTPUT.PUT_LINE('DELETE COUNT' ||SQL%rowcount );
DBMS_OUTPUT.PUT_LINE('Delectd records list in wl_score_tab table');
FOR i IN 1 .. lt_student_id.COUNT
LOOP
DBMS_OUTPUT.PUT_LINE(lpad('', 2) || 'student id :' || to_char(lt_student_id(i)) || CHR(10) || ' course id : ' || to_char(lt_course_id(i)) || CHR(10) );
END LOOP;(代码未完)
(还有 视图、 过程、等)
。。。。。。。。。。
还有好多请教各位前辈给个测试用例方法 貌似存储过程,可以参考看下数据库存储过程测试方法。 我也求呢。。。高手速度啊
页:
[1]