Re-organize the test code; Package the method 'detect_qr_code';