Skip to content

【文章自荐】如何测试电梯 #6207

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
lezhi12 opened this issue Mar 3, 2025 · 0 comments
Open

【文章自荐】如何测试电梯 #6207

lezhi12 opened this issue Mar 3, 2025 · 0 comments
Labels

Comments

@lezhi12
Copy link

lezhi12 commented Mar 3, 2025

原文链接
有一道著名的面试题是,如何测试电梯。我曾经一度觉得此题不靠谱,毕竟不了解内部实现原理,不太好设计测试用例。后来我慢慢发现,如果从计算模型的角度来考察,这是一道很好的面试题。
虽然我们并不了解电梯的工程实现,但是电梯的工作逻辑我们是清楚的(即电梯什么时候开门什么时候关门,你按一个楼层它应该上升还是下降,这些任谁都是清楚的)我们可以把电梯抽象成一个计算模型——“有限状态机”。设计有限状态机来模拟电梯的工作,并针对该计算模型设计一些测试用例,是很好的思维训练。

@ruanyf ruanyf added the weekly label Mar 6, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants