Session Presented at 2nd IndicThreads.com Conference On Software Quality held on 25-26 March 2011 in Pune, India WEB: http://Q11.IndicThreads.com
Welcome message from author
This document is posted to help you gain knowledge. Please leave a comment to let me know what you think about it! Share it to your friends and learn new things together.
Transcript
1. Proving correctness of a multiplayer game server Nirmalya
Sengupta Freelance Software Technologist Nirmalya Sengupta
2. Background
Dutch company, decided to enter Online Poker market
Indian start-up given the job of development, deployment and
support
Scope: an entire betting game environment
First version to be deployed in 12 months time
Nirmalya Sengupta
3. Application: a birds eye view Nirmalya Sengupta Player
Portal Game Server Lobby Server Tournament Server Database
RabbitMQ
4. Servers must be ...
Robust
Network ready
Support for Statefulness
Easy to interface with external systems
Highly threaded
RedDwarf (previously Darkstar)
Nirmalya Sengupta
5. Important aspects of Server
Reactive to Events : Events give rise to other Events
Actions on Events are taken by Tasks (piece of code)
Tasks are scheduled (asynchronous), not executed
immediately
Nirmalya Sengupta
6. Important aspects of Functionality
Randomness : legal requirement
Arbitrarily fired Timer s: necessity
Network connection with player can drop anytime: game must
continue
Multiple simultaneous tables & tournaments
Game History must be retained : legal requirement
Nirmalya Sengupta
7. Important aspects of Design
Home-grown binary protocol between client and server
Application waits for and reacts to Event s only
Accurate detection of network connections availability
Tasks handle Event s ( asynchronously )
Database plays an adjunct role (post-facto)
Nirmalya Sengupta
8. Picture: player joins while game is continuing Nirmalya
Sengupta
9. Picture: Player plays on two tables, leaves one Nirmalya
Sengupta Real World (Player using client software) Virtual World
(Player represented in server software) Network connection
10. How to test a software which..
is distributed
is completely asynchronous
is asking testers to be good Poker players
is affected by Timers (arbitrariness)
Must withstand tens of thousands of simultaneous Players
is expected to display minimum latency always
Nirmalya Sengupta
11. Steps taken to increase testability
Gamerules and Business rules contained in a FSM
Robot s written which could play Poker
Binary protocol carried Roundtrip time data
Facility to fire pre-configured Timers
Specialized Sniffer tasks deployed
Handcrafted cards were dealt to players
Deployed Event pattern detection ( Esper )
Nirmalya Sengupta
12. Our observations
Designer must consider phases of QA , Deployment and Support
while designing structure and feature
Asynchronous, Event-driven software offer different challenges
and benefits