47 lines
1.2 KiB
Plaintext
Raw Permalink Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

@startuml cause-effect
title 因果图 — 登录功能输入验证
' ========== 布局 ==========
left to right direction
skinparam defaultTextAlignment center
skinparam rectangle {
RoundCorner 15
}
' ========== 原因 (Causes) ==========
rectangle "原因" as causes {
rectangle "C1\n账号长度 ≥ 6" as C1 #LightBlue
rectangle "C2\n账号长度 ≤ 10" as C2 #LightBlue
rectangle "C3\n账号为纯数字\n自然数" as C3 #LightBlue
rectangle "C4\n密码长度 = 8" as C4 #LightBlue
}
' ========== 中间节点 ==========
rectangle "M1\n账号合法\n(C1 ∧ C2 ∧ C3)" as M1 #Wheat
' ========== 结果 (Effects) ==========
rectangle "结果" as effects {
rectangle "E1\n显示\"输入合法\"" as E1 #LightGreen
rectangle "E2\n显示\"账号不合法\"" as E2 #Salmon
rectangle "E3\n显示\"密码不合法\"" as E3 #Salmon
}
' ========== 关系 ==========
C1 --> M1 : AND
C2 --> M1 : AND
C3 --> M1 : AND
M1 --> E1 : AND
C4 --> E1 : AND
M1 ..> E2 : NOT\n(~M1 → E2)
C4 ..> E3 : NOT\n(~C4 → E3)
' ========== 约束 ==========
note bottom of causes
约束: C1, C2, C3 相互独立
C4 独立于 C1/C2/C3
end note
@enduml