Writing tests with Blockly

195 views
Skip to first unread message

anj...@code.org

unread,
Jan 27, 2021, 11:56:52 AM1/27/21
to Blockly
Does anyone know of any Blockly projects that allow users to write unit tests for their programs? Not sure exactly what I'm looking for, but interested to hear about any related work that people know about. Maybe something like a block library for making assertions or other kinds of validation checks?

thanks!
anjali

Beka Westberg

unread,
Jan 27, 2021, 4:50:01 PM1/27/21
to blo...@googlegroups.com
Hi anjali,

So you mean like an editor that allows you to test the block-programs you write with blocks? I haven't heard of one, but that sounds really cool!

The closest things I can think of are:
1) MakeCode's debugger interface, which allows you to set breakpoints and see variable state. Not related to unit testing, but debugging is kind of close to unit testing I hope? haha
2) Blockly's generator tests. These are blocks that allow you to test that blockly's code generators are working correctly. You can't test your blockly /programs/, but it is unit testing!

Hopefully others have more resources for you!
--Beka

--
You received this message because you are subscribed to the Google Groups "Blockly" group.
To unsubscribe from this group and stop receiving emails from it, send an email to blockly+u...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/blockly/d6ea68b2-bcaa-42c2-b40a-e9925d0e2a10n%40googlegroups.com.

ewpa...@gmail.com

unread,
Jan 28, 2021, 5:28:55 PM1/28/21
to Blockly
In App Inventor we also use Blockly to create unit tests for our blocks and those tests are evaluated as part of our unit test framework. We use this to ensure that the Android and iOS runtimes produce the same results.

Cheers,
Evan

Reply all
Reply to author
Forward
0 new messages