Menu

Post image 1
Post image 2
Post image 3
Post image 4
Post image 5
Post image 6
Post image 7
1 / 7
0

Branch Coverage for Lua with cluacov: From Line-Level Approximation to Instruction-Level Precision

DEV Community: lua·yeshan333·3 days ago
#SSrU61JD
#dev#line#branch#cluacov#path#coverage
Reading 0:00
15s threshold

I recently spent some spare time reworking cluacov , a C extension around LuaCov , with help from GPT-5.5 and Claude Opus 4.7. The result was a branch-coverage pipeline with real output: https://shansan.top/cluacov/ . The test corpus behind that report lives in the e2e directory . 【中文】 Introduction Line coverage answers a simple question: "Did this line execute?" That is useful, but it is often not the question you actually care about. For testing quality, the stronger question is: "Did both paths of this branch execute?" Consider this Lua code: if a or b or c then do_something () end Enter fullscreen mode Exit fullscreen mode A line-based tool can only tell you that the if line ran. It cannot tell you whether only a was tested, or whether b and c were also reached. At the bytecode level, the Lua compiler emits three independent TEST decisions for the short-circuit chain. That means there are three distinct branch sites, not one.…

Continue reading — create a free account

Join HashtagPLUS to read full articles, follow hashtags, vote, and join the conversation.

Read More