@testset "generate.jl" begin
    manager = ExperimentManager(db="choleskytest")
    init_manager(manager)
    @testset "gendecomposition" begin
        instance_name, oid = gendecomposition(manager, "./case9.m",
                                              Dict(:degree_max => Dict(:degree => 10)),
                                              Dict(:degree_max => Dict(:degree => 10)),
                                              3)
        @test isdecomposition(manager.decompositions, instance_name, oid)
        decomposition = getdecomposition(manager.decompositions, instance_name, oid)
        @test haskey(decomposition["options_src"], "degree_max")
        @test haskey(decomposition["options_src"]["degree_max"], "degree")
        @test decomposition["options_src"]["degree_max"]["degree"] == 10
        @test haskey(decomposition["options_dst"], "degree_max")
        @test haskey(decomposition["options_dst"]["degree_max"], "degree")
        @test decomposition["options_dst"]["degree_max"]["degree"] == 10
        @test decomposition["nb_added_edges"] == 3
    end
    @testset "gendecomposition_all" begin
        instances_names, oids = gendecomposition_all(manager,
                                                     Dict(:degree_min => Dict(:degree => 0)),
                                                     Dict(:degree_min => Dict(:degree => 0)),
                                                     2)
        for (instance_name, oid) in zip(instances_names, oids)
            @test isdecomposition(manager.decompositions, instance_name, oid)
            decomposition = getdecomposition(manager.decompositions, instance_name, oid)
            @test haskey(decomposition["options_src"], "degree_min")
            @test haskey(decomposition["options_src"]["degree_min"], "degree")
            @test decomposition["options_src"]["degree_min"]["degree"] == 0
            @test haskey(decomposition["options_dst"], "degree_min")
            @test haskey(decomposition["options_dst"]["degree_min"], "degree")
            @test decomposition["options_dst"]["degree_min"]["degree"] == 0
            @test decomposition["nb_added_edges"] == 2
        end
    end
    @testset "gendecomposition_all_json" begin
        instances_names, oids = gendecomposition_all_json(manager, "config.json")
        for (instance_name, oid) in zip(instances_names, oids)
            @test isdecomposition(manager.decompositions, instance_name, oid)
            decomposition = getdecomposition(manager.decompositions, instance_name, oid)
            @test haskey(decomposition["options_src"], "size_biggest_clique_max")
            @test haskey(decomposition["options_src"]["size_biggest_clique_max"], "size")
            @test decomposition["options_src"]["size_biggest_clique_max"]["size"] == 9
            @test haskey(decomposition["options_dst"], "size_biggest_clique_max")
            @test haskey(decomposition["options_dst"]["size_biggest_clique_max"], "size")
            @test decomposition["options_dst"]["size_biggest_clique_max"]["size"] == 9
            @test decomposition["nb_added_edges"] == 4
        end
    end
    @testset "gendecomposition_all_jsons" begin
        ids = gendecomposition_all_jsons(manager, "config_mult.json")
        for (instance_name, oid) in zip(ids["gen1"]...)
            @test isdecomposition(manager.decompositions, instance_name, oid)
            decomposition = getdecomposition(manager.decompositions, instance_name, oid)
            @test haskey(decomposition["options_src"], "degree")
            @test haskey(decomposition["options_src"]["degree"], "degrees")
            @test decomposition["options_src"]["degree"]["degrees"] == [1, 2, 3, 4, 5, 6, 7, 8, 9]
            @test haskey(decomposition["options_dst"], "degree")
            @test haskey(decomposition["options_dst"]["degree"], "degrees")
            @test decomposition["options_dst"]["degree"]["degrees"] == [1, 2, 3, 4, 5, 6, 7, 8, 9]
        end
        for (instance_name, oid) in zip(ids["gen2"]...)
            @test isdecomposition(manager.decompositions, instance_name, oid)
            decomposition = getdecomposition(manager.decompositions, instance_name, oid)
            @test haskey(decomposition["options_src"], "size_smallest_clique_max")
            @test haskey(decomposition["options_src"]["size_smallest_clique_max"], "size")
            @test decomposition["options_src"]["size_smallest_clique_max"]["size"] == 9
            @test haskey(decomposition["options_dst"], "size_smallest_clique_max")
            @test haskey(decomposition["options_dst"]["size_smallest_clique_max"], "size")
            @test decomposition["options_dst"]["size_smallest_clique_max"]["size"] == 9
            @test decomposition["nb_added_edges"] == 4
        end
    end
    @testset "genoriginal" begin
        instance_name, oid = genoriginal(manager, "case9.m")
        @test isdecomposition(manager.decompositions, instance_name, oid)
        decomposition = getdecomposition(manager.decompositions, instance_name, oid)
        @test isempty(decomposition["options_src"])
        @test isempty(decomposition["options_dst"])
        @test decomposition["nb_added_edges"] == 0
    end
end
