一、合同管理系统详细设计说明内容
系统管理模块
(1)分配合同管理:
●输入项目:。
状态为“起草”的待分配合同信息,会签、审批和签订的人员信息。
(2)角色管理
●输入项目:
新增角色名称、角色权限信息。
查询统计模块
(1)合同信息查询管理:
●性能:提供快速准确的查询合同功能,查询条件为合同编号,响应时间在合理范围内,最终能能清晰展示查询结果。
●输入项日:合同编号
(2)合同流程查询管理:
●性能:提供快速准确的查询合同功能,查询条件为合同状态,响应时间在合理范围,且能清晰准确的展示合同列表
二、调色板程序功能调试
class Palette {
public int number; // 颜色数
private ColorX[] palette; // 颜色表
public Palette(ColorX[] palette,int number) {
this.number = number;
this.palette = palette;
}
// 新增下方的同名无参数构造函数,初始化颜色表数组
public Palette() {
this.number = 0;
this.palette = new ColorX[256]; // 假设最多256种颜色
}
public void addColor(ColorX color) {
this.palette[this.number] = color;
}
// 将上面红色的部分修改为完善addColor方法
public void addColor(ColorX color) {
if (number < palette.length) {
this.palette[this.number] = color;
this.number++; // 增加颜色计数
} else {
System.out.println("调色板已满,无法添加更多颜色");
}
}
2.请写出修正后的程序运行效果
运行结果:
0DDF20DB26D5D980BB44BEC639D6322996FA9B95CAFBB0C7DFEAA6D04611328556CB6464BDFAB8CD
写出改程序的运行结果:
这个程序定义了两个类:ColorX(颜色类)和 Palette(调色板类),并在 Draw 类的 main 方法中创建了一个调色板,并向其中添加了13种颜色,最后输出调色板的字符串表示
最终结果是一个颜色数量(2位十六进制) + 13种颜色的十六进制值(每个6位)的拼接字符串
四、密码PasswordCheck单元测试。
public class PasswordCheck {
public String check(String password) {
if (password.isEmpty()) {
return "错误";
}
int length = password.length();
if (length < 6) {
return "错误";
}
if (password.matches("[0-9a-z+]")){
return "弱密码";
}else {
return "强密码";
}
}
}
请针对check函数功能编写测试用例。
import static org.junit.jupiter.api.Assertions.*;
import org.junit.jupiter.api.Test;
import org.junit.jupiter.params.ParameterizedTest;
import org.junit.jupiter.params.provider.ValueSource;
class PasswordCheckTest {
private PasswordCheck checker = new PasswordCheck();
// 测试空密码
@Test
void testEmptyPassword() {
assertEquals("错误", checker.check(""));
}
// 测试长度不足的密码
@ParameterizedTest
@ValueSource(strings = {"", "a", "abcde"})
void testShortPasswords(String password) {
assertEquals("错误", checker.check(password));
}
// 测试弱密码(只包含小写字母和数字)
@ParameterizedTest
@ValueSource(strings = {"abcdef", "12345678", "abc123"})
void testWeakPasswords(String password) {
assertEquals("弱密码", checker.check(password));
}
// 测试强密码(包含大写字母或特殊字符)
@ParameterizedTest
@ValueSource(strings = {"Abcdef", "abc@123", "ABC123", "a1B2c3"})
void testStrongPasswords(String password) {
assertEquals("强密码", checker.check(password));
}
// 测试边界长度(刚好6个字符)
@Test
void testMinimumLength() {
assertEquals("弱密码", checker.check("abcdef"));
assertEquals("强密码", checker.check("Abc123"));
}
// 测试包含特殊字符的密码
@Test
void testWithSpecialCharacters() {
assertEquals("强密码", checker.check("abc@123"));
assertEquals("强密码", checker.check("!@#$%^&*"));
}
}