TE
科技回声
首页24小时热榜最新最佳问答展示工作
GitHubTwitter
首页

科技回声

基于 Next.js 构建的科技新闻平台,提供全球科技新闻和讨论内容。

GitHubTwitter

首页

首页最新最佳问答展示工作

资源链接

HackerNews API原版 HackerNewsNext.js

© 2025 科技回声. 版权所有。

Ask HN: Implications of (super)permutations on software testing?

2 点作者 construct0将近 2 年前

2 条评论

construct0将近 2 年前
Messed the Ask HN up with a link. Reposted, this one may be removed.
construct0将近 2 年前
Hi HN.<p>Junior software developer here.<p>I recently stumbled upon the minimal superpermutation problem and I&#x27;m trying to figure out what the implications are for software developers when it comes to effectively testing their code.<p>(Below is an explorative example in an attempt to try and get more clarity about this. Perhaps I&#x27;m looking at it in the wrong way, hope some people can share their view on this. Questions at end of post.)<p>The best example to illustrate what I mean by that would be to use a complex online videogame as the example of a software application in need of effective testing.<p>Such a videogame, to me, consists out of a considerable amount of active and mutable state which is exhaustively queried and constantly in flux.<p>Consider that an optimal amount of coupling &amp; cohesion is pursued but that due to the videogame&#x27;s inherent complexity, developmental time constraints, managerial decisions, incompetency, .., the development team inevitably introduces mistakes in this regard.<p>Envision a scenario where a single state entry can have its value queried and altered by n actors due to some of the entry&#x27;s characteristics in relation to other entries&#x27; characteristics resulting in an implied need for relational connectivity.<p>A simple example of such an entry would be the state of a particular entity represented by an enum.<p>With testing in mind, imagine that in order to provide security to block prohibited state transitions a table could be made containing the permitted state transitions.<p>Sounds like a good solution when there are not a lot of possible states defined in the enum. Sounds even better when you realize that the table is an allowlist and that not all transitions have to be included. Sounds great when you&#x27;re only considering single-step state changes.<p>However such a table is not aware of the context encapsulated within an actor, the actor may alter the state as permitted by the table, even when it may not be the appropriate state to change to, e.g. due to a logical error.<p>My interpretation is then that in order for the transition table to become more effective in preventing undesired transitions, it is implied that it must contain the constituents of an actor&#x27;s context which are determined to be in some way involved in the logic which decides which state the enum should transition to.<p>It seems to me that including those variables in the table would lead to a large amount of scenarios to consider and write tests for. It becomes even more tricky when those actors have some sort of relationship with eachother, and even trickier when they themselves have dependencies.<p>Then there&#x27;s the possibility that you do not want to perform a state transition you have performed before, that you do not want to do that when one or more actors has a certain state, and so forth.<p>Whether such a table would have any value beyond a certain amount of columns, I am not certain. But this line of thinking made me think of permutations (if you&#x27;d be willing to have subsets) and makes me wonder whether the minimal superpermutation problem has any value when talking about testing software?<p>In my experience so far writing unit tests I can usually assert that all paths have been covered, but once in a while I&#x27;ll come across a case where testing all possible combinations becomes a near impossible task.<p>While searching I came across &quot;combinatorial testing&quot;, seems relevant but still fail to see how it all ties together (theoretically and actionably)?<p><a href="https:&#x2F;&#x2F;personal.utdallas.edu&#x2F;~ewong&#x2F;SE6367&#x2F;03-Lecture&#x2F;29-A-Combinatorial-Testing-by-Kuhn.pdf" rel="nofollow noreferrer">https:&#x2F;&#x2F;personal.utdallas.edu&#x2F;~ewong&#x2F;SE6367&#x2F;03-Lecture&#x2F;29-A-...</a>