Rewrite your Ruby VM at runtime to hot patch useful features »
Created at: 23.11.2009 14:59, source: time to bleed by Joe Damato, tagged: bugfix debugging linux monitoring python ruby systems testing x86 allocator debug garbage collection GC memory x86_64

If you enjoy this article, subscribe (via RSS or e-mail) and follow me on twitter.
Some notes before the blood starts flowin’
- CAUTION: What you are about to read is dangerous, non-portable, and (in most cases) stupid.
- The code and article below refer only to the x86_64 architecture.
- Grab some gauze. This is going to get ugly.
TLDR
This article shows off a Ruby gem which has the power to overwrite a Ruby binary in memory while it is running to allow your code to execute in place of internal VM functions. This is useful if you’d like to hook all object allocation functions to build a memory profiler.
This gem is on GitHub
Yes, it’s on GitHub: http://github.com/ice799/memprof.
I want a memory profiler for Ruby
This whole science experiment started during RubyConf when Aman and I began brainstorming ways to build a memory profiling tool for Ruby.
The big problem in our minds was that for most tools we’d have to include patches to the Ruby VM. That process is long and somewhat difficult, so I started thinking about ways to do this without modifying the Ruby source code itself.
The memory profiler is NOT DONE just yet. I thought that the hack I wrote to let us build something without modifying Ruby source code was interesting enough that it warranted a blog post. So let’s get rolling.
What is a trampoline?
Let’s pretend you have 2 functions: functionA() and functionB(). Let’s assume that functionA() calls functionB().
Now also imagine that you’d like to insert a piece of code to execute in between the call to functionB(). You can imagine inserting a piece of code that diverts execution elsewhere, creating a flow: functionA() –> functionC() –> functionB()
You can accomplish this by inserting a trampoline.
A trampoline is a piece of code that program execution jumps into and then bounces out of and on to somewhere else1.
This hack relies on the use of multiple trampolines. We’ll see why shortly.
Two different kinds of trampolines
There are two different kinds of trampolines that I considered while writing this hack, let’s take a closer look at both.
Caller-side trampoline
A caller-side trampoline works by overwriting the opcodes in the .text segment of the program in the calling function causing it to call a different function at runtime.
The big pros of this method are:
- You aren’t overwriting any code, only the address operand of a
callqinstruction. - Since you are only changing an operand, you can hook any function. You don’t need to build custom trampolines for each function.
This method also has some big cons too:
- You’ll need to scan the entire binary in memory and find and overwrite all address operands of
callq. This is problematic because if you overwrite any false-positives you might break your application. - You have to deal with the implications of
callq, which can be painful as we’ll see soon.
Callee-side trampoline
A callee-side trampoline works by overwriting the opcodes in the .text segment of the program in the called function, causing it to call another function immediately
The big pro of this method is:
- You only need to overwrite code in one place and don’t need to worry about accidentally scribbling on bytes that you didn’t mean to.
this method has some big cons too:
- You’ll need to carefully construct your trampoline code to only overwrite as little of the function as possible (or some how restore opcodes), especially if you expect the original function to work as expected later.
- You’ll need to special case each trampoline you build for different optimization levels of the binary you are hooking into.
I went with a caller-side trampoline because I wanted to ensure that I can hook any function and not have to worry about different Ruby binaries causing problems when they are compiled with different optimization levels.
The stage 1 trampoline
To insert my trampolines I needed to insert some binary into the process and then overwrite callq instructions like this:
41150b: e8 cc 4e 02 00 callq 4363dc [rb_newobj] 411510: 48 89 45 f8 ....
In the above code snippet, the byte e8 is the callq opcode and the bytes cc 4e 02 00 are the distance to rb_newobj from the address of the next instruction, 0×411510
All I need to do is change the 4 bytes following e8 to equal the displacement between the next instruction, 0×411510 in this case, and my trampoline.
Problem.
My first cut at this code lead me to an important realization: the callq instructions used expect a 32bit displacement from the function I am calling and not absolute addresses. But, the 64bit address space is very large. The displacement between the code for the Ruby binary that lives in the .text segment is so far away from my Ruby gem that the displacement cannot be represented with only 32bits.
So what now?
Well, luckily mmap has a flag MAP_32BIT which maps a page in the first 2GB of the address space. If I map some code there, it should be well within the range of values whose displacement I can represent in 32bits.
So, why not map a second trampoline to that page which can contains code that can call an absolute address?
My stage 1 trampoline code looks something like this:
/* the struct below is just a sequence of bytes which represent the
* following bit of assembly code, including 3 nops for padding:
*
* mov $address, %rbx
* callq *%rbx
* ret
* nop
* nop
* nop
*/
struct tramp_tbl_entry ent = {
.mov = {'\x48','\xbb'},
.addr = (long long)&error_tramp,
.callq = {'\xff','\xd3'},
.ret = '\xc3',
.pad = {'\x90','\x90','\x90'},
};
tramp_table = mmap(NULL, 4096, PROT_WRITE|PROT_READ|PROT_EXEC,
MAP_32BIT|MAP_ANONYMOUS|MAP_PRIVATE, -1, 0);
if (tramp_table != MAP_FAILED) {
for (; i < 4096/sizeof(struct tramp_tbl_entry); i ++ ) {
memcpy(tramp_table + i, &ent, sizeof(struct tramp_tbl_entry));
}
}
}
It mmaps a single page and writes a table of default trampolines (like a jump table) that all call an error trampoline by default. When a new trampoline is inserted, I just go to that entry in the table and insert the address that should be called.
To get around the displacement challenge described above, the addresses I insert into the stage 1 trampoline table are addresses for stage 2 trampolines.
The stage 2 trampoline
Setting up the stage 2 trampolines are pretty simple once the stage 1 trampoline table has been written to memory. All that needs to be done is update the address field in a free stage 1 trampoline to be the address of my stage 2 trampoline. These trampolines are written in C and live in my Ruby gem.
static void
insert_tramp(char *trampee, void *tramp) {
void *trampee_addr = find_symbol(trampee);
int entry = tramp_size;
tramp_table[tramp_size].addr = (long long)tramp;
tramp_size++;
update_image(entry, trampee_addr);
}
An example of a stage 2 trampoline for rb_newobj might be:
static VALUE
newobj_tramp() {
/* print the ruby source and line number where the allocation is occuring */
printf("source = %s, line = %d\n", ruby_sourcefile, ruby_sourceline);
/* call newobj like normal so the ruby app can continue */
return rb_newobj();
}
Programatically rewriting the Ruby binary in memory
Overwriting the Ruby binary to cause my stage 1 trampolines to get hit is pretty simple, too. I can just scan the .text segment of the binary looking for bytes which look like callq instructions. Then, I can sanity check by reading the next 4 bytes which should be the displacement to the original function. Doing that sanity check should prevent false positives.
static void
update_image(int entry, void *trampee_addr) {
char *byte = text_segment;
size_t count = 0;
int fn_addr = 0;
void *aligned_addr = NULL;
/* check each byte in the .text segment */
for(; count < text_segment_len; count++) {
/* if it looks like a callq instruction... */
if (*byte == '\xe8') {
/* the next 4 bytes SHOULD BE the original displacement */
fn_addr = *(int *)(byte+1);
/* do a sanity check to make sure the next few bytes are an accurate displacement.
* this helps to eliminate false positives.
*/
if (trampee_addr - (void *)(byte+5) == fn_addr) {
aligned_addr = (void*)(((long)byte+1)&~(0xffff));
/* mark the page in the .text segment as writable so it can be modified */
mprotect(aligned_addr, (void *)byte+1 - aligned_addr + 10,
PROT_READ|PROT_WRITE|PROT_EXEC);
/* calculate the new displacement and write it */
*(int *)(byte+1) = (uint32_t)((void *)(tramp_table + entry)
- (void *)(byte + 5));
/* disallow writing to this page of the .text segment again */
mprotect(aligned_addr, (((void *)byte+1) - aligned_addr) + 10,
PROT_READ|PROT_EXEC);
}
}
byte++;
}
}
Sample output
After requiring my ruby gem and running a test script which creates lots of objects, I see this output:
... source = test.rb, line = 8 source = test.rb, line = 8 source = test.rb, line = 8 source = test.rb, line = 8 source = test.rb, line = 8 source = test.rb, line = 8 source = test.rb, line = 8 ...
Showing the file name and line number for each object getting allocated. That should be a strong enough primitive to build a Ruby memory profiler without requiring end users to build a custom version of Ruby. It should also be possible to re-implement bleak_house by using this gem (and maybe another trick or two).
Awesome.
Conclusion
- One step closer to building a memory profiler without requiring end users to find and use patches floating around the internet.
- It is unclear whether cheap tricks like this are useful or harmful, but they are fun to write.
- If you understand how your system works at an intimate level, nearly anything is possible. The work required to make it happen might be difficult though.
Thanks for reading and don't forget to subscribe (via RSS or e-mail) and follow me on twitter.
References
more »
Let a human test your app, not (just) unit tests »
Created at: 29.10.2009 19:06, source: Rail Spikes - Home, tagged: testing
I’m a big believer in unit testing. We unit test our Rails apps extensively, and we’ve done so for years. On some projects, we do both unit testing and integration testing using Cucumber. I preach unit testing to everyone I can. I’d probably turn down a project if the client wouldn’t let us write tests (though this has never come up, and I don’t think it would be a hard sell).
But for a long time, that’s all I did on my projects. Our clients and users would find the bugs that got past the developers. They were, in effect, our QA testers. (I think a lot of small/agile teams are the same way; based on my experience, I’d be surprised if more than 20% of Rails projects were comprehensively tested by a human.)
This is not right. A good QA tester is worth the surprisingly modest expense.
If I unit test, do I really need to hire a QA tester?
Keep on writing unit tests. But unit tests and human testing are two completely different things. They both aim to increase code quality and decrease bugs, but they do this in different ways.
Developer (unit) testing has three benefits. It:
- Makes refactoring possible. Don’t even try to refactor a large app without a test suite.
- Speeds up development. I know there are some haters who deny this, but they’ve either never really given unit testing a chance, or their experience has been 180º different than mine.
- Eliminates some bugs. Not all, but some.
Human testing has related, but somewhat different, benefits. It:
- Eliminates other bugs. Unit tests are great for certain categories of bugs, but not for others. When a human walks through an application with the express purpose of making things break, they’re going to find things that developer-written unit tests won’t find.
- Acts as a “practice run”. Before letting a client, boss, or user see a change, let a QA tester see it. You’d be surprised how many 500 errors and IE incompatibilities you can avoid.
- Gives you confidence before you deploy. After working with good QA testers, I can’t imagine deploying an app to production without having a QA tester walk through it.
- Saves you time. If you don’t have a QA role on your project, your developers will be defacto testers. They probably won’t do a good job at this, since they’ll be hoping things succeed (rather than making them fail). And their time is probably more expensive than a good tester’s time.
How to use a QA tester in an agile project
Agile testers should do four things.
First, they should verify or reject each story that is completed. Every time a developer indicates that a feature or bug is completed, whether you use a story tracker or index cards, a QA tester should verify this. Don’t deploy to production until the tester gives it a thumbs-up.
Second, they should do exploratory testing after every deploy. A few minutes clicking around in production can sniff out a lot of potential errors.
Third, they should test edge cases. What happens if a user types in a username that is 300 characters long? What they try to delete an item that is still processing? What if they upload a PDF file as an avatar? Testers are great at this sort of thing.
Fourth, they should test integrations. Unit tests can’t (and shouldn’t) test multi-step processes. Integration testing tools like Cucumber are OK, but don’t catch everything. Identify the main multi-step processes on your site, and have a human verify them every time they change.
Expect a tester to increase your development costs by 5%-10%. We find that 1 hour of testing for every 6 hours of developer time is a reasonable estimate. Our testers cost about 40% less than our developers. So on a typical invoice, testing services are about 10% of development services.
Bill separately for testing. Don’t just roll it into your developer rate. Clients are more likely to object to a 10% increase in your main hourly rate than a separate, lower testing line item.
Finding a good tester
There are two main ways to find a tester.
First, you can train one. Tech-savvy folks who aren’t programmers are a good option. They understand enough to fit in with your development process, but are happy testing and not coding. If you find the right person, they can be testing in no time, and won’t cost a ton of money.
Second, find one that understands agile development. There are plenty of professional testers out there, but most of them do waterfall testing: spend 3 weeks writing test cases, get release from developers, and spend 3 weeks testing. I can say, without hyperbole, that this is how exactly 0% of Rails development projects work. Look for the small number of testers that actually have experience with iterative development, flexible scope, and rapid turnaround. You can sometimes find these people at agile events (conferences or user groups). Otherwise, ask other developers. I found one via referral, and I’ve since referred him to others. This second category will probably be more expensive than the first, but if you want to ship the best code you can, go with this route.
more »
Defeating the Matasano C++ Challenge with ASLR enabled »
Created at: 16.10.2009 14:59, source: time to bleed by Joe Damato, tagged: bugfix debugging linux security systems testing x86 memory vulnerability x86_64

If you enjoy this article, subscribe (via RSS or e-mail) and follow me on twitter.
Important note
I am NOT a security researcher (I kinda want to be though). As such, there are probably way better ways to do everything in this article. This article is just illustrating my thought process when cracking this challenge.
The Challenge
The Matasano Security blog recently posted an article titled A C++ Challenge1 which included a particularly ugly piece of C++ code that has a security vulnerability. The challenge is for the reader to find the vulnerability, use it execute arbitrary code, and submit the data to Matasano.
Sounds easy enough, let’s do this! cue hacking music
Making it harder
Recent linux kernels have feature called Address Space Layout Randomization (ASLR) which can be set in /proc/sys/kernel/randomize_va_space. ASLR is a security feature which randomizes the start address of various parts of a process image. Doing this makes exploiting a security bug more difficult because the exploit cannot use any hard coded addresses.
The options you can set are:
- 0 – ASLR off
- 1 – Randomize the addresses of the stack, mmap area, and VDSO page. This is the default.
- 2 – Everything in option 1, but also randomize the
brkarea so the heap is randomized.
Just for fun I decided to set it to 2 to make exploiting the challenge more difficult.
Got the code, but now what?
I decided to start attacking this problem by looking for a few common errors, in this order:
strcpy()/strncpy()bugs No callsmemcpy()bugs A few calls- Off by one bugs None obvious
It turned out from a quick look that all calls to memcpy() included sane, hard-coded values. So, it had to be something more complex.
Digging deeper – finding input streams the user can control
Next, I decided to actually read the code and see what it was doing at a high level and what inputs could be controlled. Turns out that the program reads data from a file and uses the data from the file to determine how many objects to allocate.
Obviously, this portion of the code caught my interest so let’s take a quick look:
/* ... */
fd.read(file_in_mem, MAX_FILE_SIZE-1);
/* ... */
struct _stream_hdr *s = (struct _stream_hdr *) file_in_mem;
if(s->num_of_streams >= INT_MAX / (int)sizeof(int)) {
safe_count = MAX_STREAMS;
} else {
safe_count = s->num_of_streams;
}
Obj *o = new Obj[safe_count];
OK, so clearly that if statement is suspect. At the very least it doesn’t check for negative values, so you could end up with safe_count = -1 which might do something interesting when passed to the new operator. Moreover, it appears this if statement will allow values as large as 536870910 ([INT_MAX / sizeof(int)] – 1).
Maybe the exploit has something to do with values this if statement is allowing through?
A closer look at the integer overflow in new
Let’s use GDB to take a closer look at what the compiler does before calling new. I’ve added a few comments in line to explain the assembly code:
mov %edx,%eax ; %edx and %eax store s->num_of_streams add %eax,%eax ; add %eax to itself (s->num_of_streams * 2) add %edx,%eax ; add s->num_of_streams + %eax (s->num_of_streams*3) shl $0x2,%eax ; multiply (s->num_of_streams * 3) by 4 (s->num_of_streams * 12) mov %eax,(%esp) ; move it into position to pass to new call 0x8048a7c <_Znaj@plt> ; call new
The compiler has generated code to calculate: s->num_of_streams * sizeof(Obj). sizeof(Obj) is 12 bytes. For large values of s->num_of_streams multiplying it by 12, causes an integer overflow and the value passed to new will actually be less than what was intended.
For my exploit, I ended up using the value 357913943. This value causes an overflow, because 357913943 * 12 is greater than the biggest possible value for an integer by 20. So the value passed to new is 20. Which is, of course, significantly less than what we actually wanted to allocate. Other people have written about integer overflow in new in other compilers2 before.
Let’s see how this can be used to cause arbitrary code to execute. Remember, for arbitrary code execution to occur there must be a way to cause the target program to write some data to a memory address that can be controlled.
Find the (possible) hand-off(s) to arbitrary code
To find any hand-off locations, I looked for places where memory writes were occurring in the program. I found a few memory writes:
- 2 calls to
memset() - 2 calls to
memcpy() parse_stream()ofclass Obj
Unfortunately (from the attacker’s perspective) the calls to memcpy() and memset() looked pretty sane. The parse_stream() function caught my interest, though.
Take a look:
class Obj {
public:
int parse_stream(int t, char *stream)
{
type = t;
// ... do something with stream here ...
return 0;
}
int length;
int type;
/* ... */
REMEMBER: In C++, member functions of classes have a sekrit parameter which is a pointer to the object the function is being called on. In the function itself, this parameter is accessed using this. So the line writing to the type variable is actually doing this->type = t; where this is supplied to the function sektrily by the compiler.
This is important because this piece of code could be our hand-off! We need to find a way to control the value of this so we can cause a memory write to a location of our choice.
Controlling this to cause arbitrary code to execute
Take a look at an important piece of code in the challenge:
struct imetad {
int msg_length;
int (*callback)(int, struct imetad *);
/* ... */
Nice! The callback field of struct imetad is offset by 4 bytes into the structure. The type field of class Obj is also offset by 4 bytes. See where I’m going?
If we can control the this pointer to point at the struct imetad on the heap when parse_stream is called, it will overwrite the callback pointer. We’ll then be able to set the pointer to any address we want and hand-off execution to arbitrary code!
But how can we manipulate this?
Take a look at this piece of code that calls callback:
o[i].parse_stream(dword, stream_temp); imd->callback(o[i].type, imd);
Since it is possible to overflow new and allocate fewer objects than safe_count is counting, that means that for some values of i, o[i] will be pointing at data that isn’t actually an Obj object, but just other data on the heap. Infact, when i = 2, o[i] will be pointing at the struct imetad object on the heap. The call to parse_stream will pass in a corrupted this pointer, that points at struct imetad. The write to type will actually overwrite callback since they are both offset equal amounts into their respective structures.
And with that, we’ve successfully exploited the challenge causing arbitrary code to execute.
Let’s now figure out how to beat ASLR!
How to defeat address space layout randomization
I did NOT invent this technique, but I read about it and thought it was cool. You can read a more verbose explanation of this technique here. The idea behind the technique is pretty simple:
- When you call
exec, the PID remains the same, but the image of the process in memory is changed. - The kernel uses the PID and the number of jiffies (jiffies is a fine-grained time measurement in the kernel) to pull data from the entropy pool.
- If you can run a program which records stack, heap, and other addresses and then quickly call
execto start the vulnerable program, you can end up with the same memory layout.
My exploit program is actually a wrapper which records an approximate location of the heap (by just calling malloc()), generates the exploit file, and then executes the challenge binary.
Take a look at the relevant pieces of my exploit to get an idea of how it works:
/* ... */
/* do a malloc to get an idea of where the heap lives */
void *dummy = malloc(10);
/* ... */
unsigned int shell_addr = reinterpret_void_ptr_as_uint(dummy);
/*
* XXX TODO FIXME - on my platform, execl'ing from here to the challenge binary
* incurs a constant offset of 0x3160, probably for changes in the environment
* (libs linked for c++ and whatnot).
*/
shell_addr += 0x3160;
/*
* a guess as to how far off the heap the shellcode lives.
*
* luckily we have a large NOP sled, so we should only fail when we miss
* the current entropy cycle (see below).
*/
shell_addr += 700;
/* ... build exploit file in memory ... */
/* copy in our best guess as to the address of the shellcode, pray NOPs
* take care of the rest! */
memcpy(entire_file+88, &shell_addr, sizeof(shell_addr));
/* ... write exploit out to disk ... */
/* launch program with the generated exploit file!
*
* calling execl here inherits the PID of this process, and IF we get lucky
* ~85%+ of the time, we'll execute before the next entropy cycle and hit
* the shellcode, even with ASLR=2.
*/
execl("./cpp_challenge", "cpp_challenge", "exploit", (char *)0);
My exploit for the C++ challenge
My exploit comes with the following caveats:
- i386 system
- The challenge binary is called “cpp_challenge” and lives in the same directory as the exploit binary.
- The exploit binary can write to the directory and create a file called “exploit” which will be handed off to “cpp_challenge”
Get the full code of my exploit here.
Results
Results on my i386 Ubuntu 8.04 VM running in VMWare fusion, for each level of randomize_va_space:
- 0 – 100% exploit hit rate
- 1 – 100% exploit hit rate
- 2 – ~85% exploit hit rate. Sometimes, my exploit code falls out of the time window and the address map changes before the challenge binary is run
I could probably boost the hit rate for 2 a bit, but then I’d probably re-write the entire exploit in assembly to make it run as fast as possible. I didn’t think there was really a point to going to such an extreme, though. So, an 85% hit rate is good enough.
Conclusion
- Security challenges are fun.
- More emphasis and more freely available information on secure coding would be very useful.
- Like it or not developers need to be security conscious when writing code in C and C++.
- As C and C++ change, developers need to carefully consider security implications of new features.
Thanks for reading and don’t forget to subscribe (via RSS or e-mail) and follow me on twitter.
References
more »
Testing HTTP Authentication »
Created at: 01.07.2009 04:44, source: Rail Spikes - Home, tagged: testing tips
If you ever need to test HTTP Authentication in your functional tests, here is how you do it:
1 2 3 4 5 6 |
def test_http_auth @request.env['HTTP_AUTHORIZATION'] = ActionController::HttpAuthentication::Basic.encode_credentials("quentin", "password") get :show, :id => @foobar.id assert_response :success end |
This is much like testing SSL.
Hat tip: Philipp Führer for Functional test for HTTP Basic Authentication in Rails 2.
more »
JSONQuerying Your Rails Responses »
Created at: 23.06.2009 01:44, source: RailsTips - Home, tagged: javascript json jsonquery testing
In which I show how to use a Ruby implementation of JSONQuery to test JSON in Rails apps.
I’m writing an application right now that is really JSON heavy. Some of the functional tests are cucumber and some of them are just rails functional tests using shoulda.
I hit a point today where I wanted to verify that the JSON getting output was generally what I want. I could have just JSON parsed the response body and compared that with what I was looking for, but a little part of me thought this might be a cool application of JSONQuery.
JSONQuery provides a comprehensive set of data querying tools including filtering, recursive search, sorting, mapping, range selection, and flexible expressions with wildcard string comparisons and various operators.
The quote above is fancy and can be boiled down to “a query language for JSON”. If you want to read more about JSONPath and JSONQuery here are some posts:
Finding a Ruby JSONQuery Implementation
I knew there was a JavaScript implementation of JSONQuery and that Jon Crosby has been doing some cool stuff with it in CloudKit, but I couldn’t find a Ruby implemenation that didn’t require johnson.
After some googling and Github searching, I came across Siren. Siren was pretty much what I wanted, so I started playing around with it. I forked it, gem’d it and wrapped it with some shoulda goodness.
What I ended up with was pretty specific to my needs at the moment, but I post it here in hopes that it sparks some ideas.
Bringing It All Together
First, I added the following to my environments/test.rb file.
config.gem 'jnunemaker-siren',
:lib => 'siren',
:version => '0.1.1',
:source => 'http://gems.github.com'
Then I added the following in my test helper (actually put it in separate module and file and included it but I’m going for simplicity in this post).
class ActiveSupport::TestCase
def self.should_query_json(expression, string_or_regex)
should "have json response matching #{expression}" do
assert_jsonquery expression, string_or_regex
end
end
def assert_jsonquery(expression, string_or_regex)
json = ActiveSupport::JSON.decode(@response.body)
query = Siren.query(expression, json)
if string_or_regex.kind_of?(Regexp)
assert_match string_or_regex, query, "JSONQuery expression #{expression} value did not match regex"
else
assert_equal string_or_regex, query, "Expression #{expression} value #{query} did not equal #{string_or_regex}"
end
end
end
The code is quick and dirty. The first thing you’ll notice is that assert_jsonquery actually uses @response.body, which means it can only be used in a controller test. I could easily expand it, but, like I said above, I just got it working for what I needed right now. The cool part is that now in my functional tests, I can do stuff like this:
context "on POST to :create" do
setup { post :create, :status => {'action' => 'In', 'body' => 'Working on PB' }
# ... code removed for brevity ...
should_query_json "$['replace']['#current_status']", /Working on PB/
end
That is a really basic query. Trust me you can do a heck of a lot more. Check out the Siren tests if you don’t believe me.
Conclusion
Overall, working with siren was a little rough because I wasn’t familiar with JSONQuery syntax. Also, siren tends to return nil instead of a more helpful error message about my expression compilation failing, but I’m kind of excited to see how this works out in the long run.
What are you doing to test JSON in your apps? Does something like this seem cool or overkill? Just kind of curious.
more »
