仓库管理系统设计与实现-软件工程课程设计任务书 联系客服

发布时间 : 星期五 文章仓库管理系统设计与实现-软件工程课程设计任务书更新完毕开始阅读b77869f25af5f61fb7360b4c2e3f5727a5e92499

“仓库管理系统“设计与实现

测试项编号 TS_FUN_001_005 优先级 高 验证货物汇总界面,其中的总价和总量随着入库和出库操作的执行而进行相测试项描述 应的更改,货物名称也相应改变 预置条件 应用被打开,且当前处在货物汇总界面上 用例序号 输入 TS40001 执行步骤 预期结果 表单内容相应改变, 此种货物的所有属性显示出来 表单内容相应改变, 此种货物的总量和总价也相应增加入库的数量 表单内容相应改变, 此种货物的总量和总价也相应减少出库的数量 仓库中无次货物,执打开货物汇总表单 行入库操作 仓库中有此货物,执打开货物汇总表单 行入库操作 仓库中有次货物,执打开货物汇总表单 行出库操作 TS40002 TS40003 TS40004 检查友好性 检查货物汇总作界面设界面符合习惯、美观,标签对计是否合理,符合正常齐,输入框对齐,无错别字,规范标准 字体大小协调,文字描述准确 3、白盒测试(基本路经测试法)

(1)登录模块

(a)代码

Option Explicit

Dim cnt As Integer'记录确定次数

Private Sub Form_Load()cnt = 3

Dim connectionstring As String

connectionstring = \

\conn1.Open connectionstring

Label5.Caption = \您还有\次输入密码机会!\End Sub

Private Sub label7_mouseup(Button As Integer, Shift As Integer, X As Single, Y As Single)

Label7.BorderStyle = 0Dim sql As String

Dim rs_login As New ADODB.Recordset

1: 2:

If Trim(txtuser.Text) = \判断输入的用户名是否为空

MsgBox \用户名或密码错误,请重新输入!\ txtuser.Text = \ txtpwd.Text = \ txtuser.SetFocus

3: Else

第 28页 / 共 38 页

“仓库管理系统“设计与实现

sql = \系统管理 where 用户名='\ rs_login.Open sql, conn1, adOpenKeyset, adLockPessimistic

4: 5:

If rs_login.EOF = True Then

MsgBox \用户名或密码错误,请重新输入!\

txtuser.Text = \ txtpwd.Text = \

txtuser.SetFocus

6:

Else

'检验密码是否正确

7: 8:

If Trim(rs_login.Fields(1)) = UserCode(Trim(txtpwd.Text)) Then

userID = txtuser.Text

userpow = rs_login.Fields(2) rs_login.Close Unload Me

17: MDIForm1.Show

Exit Sub

9:

Else

10:

MsgBox \用户名或密码错误,请重新输入!\

Label5.Caption = \您还有\次输入密码机会!\ txtuser.Text = \ txtpwd.Text = \

txtuser.SetFocus End If End IfEnd If

cnt = cnt - 1

11: 12:

If cnt = 0 Then

MsgBox \对不起,您已连续三次输入错误,请确认正确密码再试,谢谢!\

18: Unload Me Exit SubEnd If

End Sub

Private Sub txtpwd_Change()

13: 14:

If Len(txtpwd.Text) > 12 Then

txtpwd.Text = Left(txtpwd.Text, 12)End If

End Sub

Private Sub txtuser_Change()

15: 16:

If Len(txtuser.Text) > 12 Then

txtuser.Text = Left(txtuser.Text, 12)End If

第 29页 / 共 38 页

“仓库管理系统“设计与实现

End Sub

(b)详细流图

(c)环形复杂度18-14+2=6

图6.2.1 登录模块详细流图

(d)独立路径 路径一:13--15—1—4—7—8—17

路径二:13—15—1—2—1—4—7—8—17路径三:13—15—1—4—1—4—7—8—17

路径四:13—15—1—4—7—10—1—4—7—8—17路径五:13—14—15—16—1—4—7—8—17路径六:13—15—1—4—7—10—11—12—18(e)设计测试用例

覆盖路径 提示 溢出 溢出 错误 剩3次 “” “” 错误 剩3次 “” “” 提示 退出 进入 13—15—1—7—10—11-12--18 FFTT FFTFT 13—14—15--16 13—14—15--16 13—15—1—7 --10 13—15—1—4 FFF 编号 1 2 3 4 5 6 输入数据 txtuser txtpwd aaaaaaaaaaaaa aaaaaaaaaaaa admin aaaaaaaaaaaaa aaaaaaaaaaaaa 111 预期输出 txtuser txtpwd aaaaaaaaaaaa aaaaaaaaaaaa “” aaaaaaaaaaaa aaaaaaaaaaaa “” 提示 错误 错误 错误 剩2次 实际输出 txtuser txtpwd aaaaaaaaaaaa aaaaaaaaaaaa “” aaaaaaaaaaaa aaaaaaaaaaaa “” 判定覆盖 TT TF FFTF administrator 123 “” “” 错误 剩1次 Admin 111111 “” “” 提示 退出 admin 123 进入 表6.2.1登录模块白盒测试用例

(2)出入库录入模块 (a)代码

Private Sub Command1_Click()

第 30页 / 共 38 页

“仓库管理系统“设计与实现

Dim rs_save As New ADODB.Recordset

1: 2:

3: 4:

5: 6:

7: 8:

9: 10:

11: 12:

13: 14:

Dim sql As String

Dim i, num As Integer

Dim s As String '转化数据用

On Error GoTo saveerror

If Trim(Text1.Text) = \

MsgBox \编号不能为空!\

Text1.SetFocus

Exit Sub

End If

If Combo1.Text = \

MsgBox \请选择货源地!\

Combo1.SetFocus

Exit Sub

End If

If comboy.Text = \

MsgBox \请选择年份!\

comboy.SetFocus

Exit Sub

End If

If combom.Text = \

MsgBox \请选择月份!\

combom.SetFocus

Exit Sub

End If

If combod.Text = \

MsgBox \请选择日期!\

combod.SetFocus

Exit Sub

End If

If Text2.Text = \

MsgBox \请填写仓库编号!\

Text2.SetFocus

Exit Sub

End If

If MSFlexGrid1.Col <> 0 Then

MsgBox \请输入完整的物品信息!\

MSFlexGrid1.SetFocus

Exit Sub

End If

sql = \入出库 where 仓库编号='\

第 31页 / 共 38 页