作业要求:
在软件测试章节中中,我们介绍了不少VSTS的 软件测试工具,请使用一些其他平台上的测试工具,并写博客介绍如何在你的项目中具体使用。
一、选择开发工具
开发工具选择 Visual studio 2017 社区版,开发语言为C
由于之前已经安装完毕,所以不上传安装过程,主界面如下:
二、练习自动单元测试
使用的测试工具是VSTS,具体步骤如下:
1.编写一个判断三个数大小的程序
程序代码如下:
#include "pch.h" #include <iostream> #include "stdio.h" int test(int a,int b,int c) { int max; if (a > b) max = a; else max = b; if (c > max) max = c; return max; } int main() { int a, b, c,max; scanf_s("%d%d%d", &a, &b, &c); max = test(a, b, c); printf("max=%d", max); return 0; }
头文件代码如下:
#pragma once int test(int a, int b, int c) { int max; if (a > b) max = a; else max = b; if (c > max) max = c; return max; }