any idea on how to test gRPC API automaticly?

1,287 views
Skip to first unread message

Daniel Mal

unread,
May 11, 2015, 2:35:18 AM5/11/15
to grp...@googlegroups.com
any idea on how to test gRPC API automaticly?

Nathaniel Manista

unread,
May 14, 2015, 1:10:03 PM5/14/15
to Daniel Mal, grp...@googlegroups.com
On Sun, May 10, 2015 at 11:35 PM, Daniel Mal <daniel...@gmail.com> wrote:
any idea on how to test gRPC API automaticly?

This is a large topic and your question is only a very few words. Please elaborate on what you might have in mind?
-Nathaniel

Daniel Mal

unread,
May 14, 2015, 9:42:51 PM5/14/15
to grp...@googlegroups.com, daniel...@gmail.com
i mean, is it possible to define the expected result of the given parameters, and to generate the test code automatically.


在 2015年5月15日星期五 UTC+8上午1:10:03,Nathaniel Manista写道:

Wolfgang Grieskamp

unread,
May 15, 2015, 11:04:27 AM5/15/15
to Daniel Mal, grpc-io
There are multiple ways how one could do automatic or assisted automatic testing of rpcs:
  • Use pairwise testing to generate input messages to test one call at a time. This technique can generate relevant test inputs from large input spaces A set of tools is listed e.g. here.  
  • Use random testing, e.g. in the style of the QuickCheck tool. This can generate tests for sequences of rpcs.
  • Use model-based testing, which generates tests for sequences of RPCs based on a specification/model.
  • Use concolic testing, which tests an implementation based on discovering execution paths through your program.
For a research-oriented recent overview on automatic test generation, check out this article.

I don't know about anybody applying those techniques specifically for rpc/proto testing, so I think there are plenty of opportunities for someone who wants to make a dent ;-) Specifically, something like pairwise testing are relative low hanging fruits. In the future, Google may come out with some mechanism to attach "contracts" (validation constraints) to protos, which would aid most of those techniques.


-- 
Wolfgang

--
You received this message because you are subscribed to the Google Groups "grpc.io" group.
To unsubscribe from this group and stop receiving emails from it, send an email to grpc-io+u...@googlegroups.com.
To post to this group, send email to grp...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/grpc-io/a56c40b2-772e-4ca1-8471-0c23013adb79%40googlegroups.com.

For more options, visit https://groups.google.com/d/optout.

Daniel Mal

unread,
May 17, 2015, 9:41:06 PM5/17/15
to grp...@googlegroups.com, daniel...@gmail.com
I imagine some DSL like this :

package proto;

// geoip service definition
service GeoIP {
  rpc QueryCountry (Request) returns (CountryResult)
}

test GeoIP{
   QueryCountry(Request{"106.187.xxx.xxx"}) expect (CountryResult{"JP"})
}



在 2015年5月15日星期五 UTC+8下午11:04:27,Wolfgang Grieskamp写道:
Reply all
Reply to author
Forward
0 new messages