def _serialize_rules(rules):
    """Serialize all the Rule object as string.

    New string is used to compare the rules list.
    """
    result = [(rule_name, str(rule)) for rule_name, rule in rules.items()]
    return sorted(result, key=lambda rule: rule[0])