首页 > 其他 > 详细

结对第二次作业

时间:2018-04-15 17:43:39      阅读:172      评论:0      收藏:0      [点我收藏+]

软件工程结对编程第二次作业

四则运算要求

  • 能够自动生成四则运算练习题
  • 可以定制题目数量
  • 用户可以选择运算符
  • 用户设置最大数(如十以内、百以内等)
  • 用户选择是否有括号、是否有小数
  • 用户选择输出方式(如输出到文件、打印机等)
  • 最好能提供图形用户界面(根据自己能力选做,以完成上述功能为主)

    本次任务中扮演的角色及任务要求

    ??在本次结对作业中我是一名领航员,负责辅助驾驶员完成全部代码工作,并且为关键函数选用合适的覆盖标准设计测试用例,并编写代码进行单元自动测试。
    根据代码检查表对驾驶员的本次工作进行评价,以及对于本次工作完成500字以上的总结。

    代码测试

    技术分享图片
    四则运算代码
    选用条件覆盖对关键函数测试,代码如下:

    package softwar;
    import static org.junit.Assert.*;
    import org.junit.Test;
    public class MainTest {
    @Test
    public void test() {
    try {
        Main.PrintQuestionsFile(10, 1, 20, 1, 1);
    } catch (Exception e) {
        // TODO Auto-generated catch block
        e.printStackTrace();
    }
    }
    @Test
    public void test1() {
    try {
        Main.PrintQuestionsFile(10, 1, 20, 1, 0);
    } catch (Exception e) {
        // TODO Auto-generated catch block
        e.printStackTrace();
    }
    }
    @Test
    public void test2() {
    try {
        Main.PrintQuestionsFile(10, 1, 20, 0, 1);
    } catch (Exception e) {
        // TODO Auto-generated catch block
        e.printStackTrace();
    }
    }
    @Test
    public void test3() {
    try {
        Main.PrintQuestionsFile(10, 1, 20, 0, 0);
    } catch (Exception e) {
        // TODO Auto-generated catch block
        e.printStackTrace();
    }
    }
    @Test
    public void test4() {
    try {
        Main.PrintQuestionsFile(10, 0, 20, 1, 1);
    } catch (Exception e) {
        // TODO Auto-generated catch block
        e.printStackTrace();
    }
    }@Test
    public void test5() {
    try {
        Main.PrintQuestionsFile(10, 0, 20, 1, 0);
    } catch (Exception e) {
        // TODO Auto-generated catch block
        e.printStackTrace();
    }
    }
    @Test
    public void test6() {
    try {
        Main.PrintQuestionsFile(10, 0, 20, 0, 1);
    } catch (Exception e) {
        // TODO Auto-generated catch block
        e.printStackTrace();
    }
    }
    @Test
    public void test7() {
    try {
        Main.PrintQuestionsFile(10, 0, 20, 0, 0);
    } catch (Exception e) {
        // TODO Auto-generated catch block
        e.printStackTrace();
    }
    }
    }

结对第二次作业

原文:https://www.cnblogs.com/wwwf/p/8848304.html

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!